hi.. is it possible to send values in a socket one at a time..
like sending one then close socket connection then open it again and send another one but different..
thanks...
Printable View
hi.. is it possible to send values in a socket one at a time..
like sending one then close socket connection then open it again and send another one but different..
thanks...
The other side might get really upset with you opening and closing new connections, plus that is kind of stupid.
didnt think of that...
ah.. is there a way that a server sends its service status through a socket...
for example httpd status send to socket blah blah...
or should i send all the services in a big chunk of data?
or send them one at a time?
thanks for the reply..
> or should i send all the services in a big chunk of data?
> or send them one at a time?
So long as the receiver can tell when one ends and the next starts, send them all in quick succession.
TCP is just a stream of bytes, it's up to the sender/receiver to agree a protocol.
HTTP for example uses printable characters separated by newlines.
what i just did was i send them in a big chunk of data... when i got it from my client side..
it was written in like.. httpd#up#smtp#down#xinetd#up and so on..
i seperated them by a delimiter "#"
i saw a site that specify if that service is down by socket..
it says "connection timeout to socket".. i dont know how to that?
is there a tutorial leading to that way? thanks for the replies..