07-07-2011, 05:04 AM
(This post was last modified: 07-08-2011, 02:28 AM by crusader2010.)
Hi. Thanks for sharing this. I got a little question: is it possible to connect more than one client to this server, or does it require to create each one in a separate thread? if not, how can multi-threading be implemented within your code?
Also if i want to send for example 3 lists of strings from the client(s) to the server in one transaction how can i do it without overloading it? is it the most efficient way to put string delimiters for each "session" of sending the lists? (in other words, how can i stop the communication between the client and the server after the server received a certain string, WITHOUT initiating further data sending from the client? - basically i want to send those 3 lists of strings "at once" when i click the send button, and the server to somehow wait until it received all of them, be able to split them up, and ONLY then re-allow the client to send them again)
Edit: regarding my above question, your "bytes" array has a length of 1024. What if you send more than this amount? is there a way to make it send ANY amount of data(like a loop until all the data has been sent or a certain string has been encountered)?
Edit2: also, how can i disconnect all the clients and stop the server from listening?
Thank you very much and really sorry about asking so many questions
Also if i want to send for example 3 lists of strings from the client(s) to the server in one transaction how can i do it without overloading it? is it the most efficient way to put string delimiters for each "session" of sending the lists? (in other words, how can i stop the communication between the client and the server after the server received a certain string, WITHOUT initiating further data sending from the client? - basically i want to send those 3 lists of strings "at once" when i click the send button, and the server to somehow wait until it received all of them, be able to split them up, and ONLY then re-allow the client to send them again)
Edit: regarding my above question, your "bytes" array has a length of 1024. What if you send more than this amount? is there a way to make it send ANY amount of data(like a loop until all the data has been sent or a certain string has been encountered)?
Edit2: also, how can i disconnect all the clients and stop the server from listening?
Thank you very much and really sorry about asking so many questions