in reply to Re^8: deal data transfer
in thread deal data transfer
It seems I can use 2 ways below to treat it:
Looking at the protocol, (which is pretty badly designed IMO), you're going to have to use a mixture of both methods.
Don't forget to binmode your socket and use sysread. I've found that wrapping sysread in a sub that checks the return code and returns the result for assignment makes life much easier.
That still leaves the problem of timeouts. There are various ways of tackling that--alarm, ioctl, select etc. Which is appropriate will depend a lot on you platform. That said, tcpip comms is pretty reliable especially if LAN connected. It may be a sufficiently infrequent occurrence that you can essentially ignore it. That will depend upon your circumstances and network.
|
|---|