i want to use sockets to login to a server and query the server.
i have managed to establish a connection and to send and recive answer.
what do i need to do if i want to send data and recive data more then one time wihtought closing the session?
(i will close the session at the end of the process).
Thanks
Peleg
sockets
Moderator: General Moderators
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: sockets
Not possible unless the protocol supports it.
HTTP doesn't support keeping connection opened, you have to close and reopen to request new information!
HTTP doesn't support keeping connection opened, you have to close and reopen to request new information!
- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
Re: sockets
you mean that in the same page if i send a message to a socket and recive and answer i cant send again another message??
-
crazycoders
- Forum Contributor
- Posts: 260
- Joined: Tue Oct 28, 2008 7:48 am
- Location: Montreal, Qc, Canada
Re: sockets
No, it's not a socket issue, it's a protocol issue...
If the protocol you use is made to receive more messages such as an FTP control connection, then you can send many messages, but HTTP is a one way one receive thats all!
So you gotta close the socket and reconnect, but you can reopen one in the same PHP page to do more requests... that is not limited....
If the protocol you use is made to receive more messages such as an FTP control connection, then you can send many messages, but HTTP is a one way one receive thats all!
So you gotta close the socket and reconnect, but you can reopen one in the same PHP page to do more requests... that is not limited....