Hello, MORE Winsock stuff!
Hi, I've encountered a problem in sending UDTs AND strings using winsock.
I have read up on both cases, and can understand them. However, i dont understand how to do a pre test. Ive heard something about array of bytes, but their code does not work for me.
ANyway, I was wondering if making 2 winsock controls, 1 for sending UDTs and 1 for strings was probable or even possible? If it IS possible, is it considered a nono? thanks in advance!
Re: Hello, MORE Winsock stuff!
Re: Hello, MORE Winsock stuff!
Are you able to send a UDT or a string but not both?
In this case you would have to put a header on your message which tells the receiver what is coming next. I often use a leading byte to identify what data will follow, maybe even another two bytes (or more) to say how long the following data stream is going to be.
You could use two winsock controls but I think that is wasteful of your resources.
On the receiving end you can read the data into a string or an array of bytes and then parse it into the UDT (or whatever) based on the leading byte's value.
Re: Hello, MORE Winsock stuff!
alright thanks, ill look into that more and try it!
Re: Hello, MORE Winsock stuff!
alright... i have sopme questions.. i am using this site as a guide http://support.microsoft.com/default...;EN-US;q152058
i use their example, and it works. when i use my UDT, its much bigger,a dn I think it overflows. is there a way to make it allow sending larger UDTs.. ALSO, i really dont understand what you mean. i tried lookin it up, saw some code with comments, and i just dont get it, so terribly sorry. if there's a tutorial you reccomend, send the link please!
Re: Hello, MORE Winsock stuff!