[Sussex] Sockets - PHP, Fedora Core 3
Steve Dobson
steve at dobson.org
Thu Nov 10 11:47:58 UTC 2005
On Thu, Nov 10, 2005 at 11:00:53AM -0000, Brendan Whelan wrote:
> Steve,
>
> Thanks for the response. Yes it is for an TCP connection but there will only
> be one client system supplying data so I may only need a straightforward
> mechanism. To help matters further, the client will only be sending under
> 100 messages a day each up to only 100 characters. The sender will await an
> ACK from me and so will resend any message where a confirmation is not
> received.
Even if there is only one client socket_select() is still the way to go.
It calls the select(2) statement (from the docs I've read) which is the
correct way to do this. If you only want to accept one client then
accept and then close the connection.
Also TCP is a reliable connection. Bytes you send will be received in
the same order and complete. There is no need to resend. If the ACK
as not been received then that is because there is a network problem
(or the server has died). The only reason for an ACK is to tell the
client it is free to send more data.
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20051110/16e14dff/attachment.pgp
More information about the Sussex
mailing list