quick tcp question
-
-
What I meant to ask was how would you go about creating your own protocol so the client knew what type of message it was recieving (could be text or other type of data). Also would it be ok to create 2 seperate sockets, one for sending and one for recieving? Thankyou
-
What I meant to ask was how would you go about creating your own protocol so the client knew what type of message it was recieving (could be text or other type of data). Also would it be ok to create 2 seperate sockets, one for sending and one for recieving? Thankyou
u can follow the generic format ie. ____________________________ command |length |data |CRC | ------------------------------------- if you are sending as string separate each with a spl char. like "$". or if it is byte array, convert the formated string to byte array using this ASCIIEncoding.GetBytes(stringpkt) qn#2 it is ok to send it as 2 packets, as long as you have identity for packets & also the client must understand ur protocol format. eg. you can maintain one field on the packet to identify "Packet is over or not", if not over, client will listen for rest of the packets regards, Srini
modified on Wednesday, February 13, 2008 10:12 PM