Sigh.... winsock again.
OK I have taken my TYPE variable and made it into a big string I can send over the winsock. Now the total size of the packet is about 3k. If I test with myself, or over my LAN, it sends the packet with no problems. But when I try to send it to someone over the internet, the packet does not finish at the time the DATAARRIVAL event occurs.
1. What is the max (or best recommended size) of a single string to send over the internet using winsock?
2. Is there a way I can tell VB to wait until the packet is fully recieved WITHOUT stopping the entire program in a loop holding the for the packet, or do I gotta break up the 3k into several smaller packets?
3. I thought it was possible to do something like Winsock.Senddata Data1, Data 2, Data3. But I get an error when I try. Can that be done? How?
Thanks so much. You guys have helped me a lot so far...
Edited by - edgecrusher on June 17, 2001 11:40:35 PM
1) 1500 bytes (or so) is the maximum packet size; if you go over this it takes mutliple packets to send the data
2) The best method is to use a thread and asyncronous sockets; neither of those are options in VB. You might be able to add ''WithEvents'' to the socket object, and if it works, one of the events should be ''Got New Data''. I''ve have miserable experiences with VB events (they never seem to work).
3) Loop?
And 3k for 1 variable is ungodly huge.
Magmai Kai Holmlor
- The disgruntled & disillusioned
2) The best method is to use a thread and asyncronous sockets; neither of those are options in VB. You might be able to add ''WithEvents'' to the socket object, and if it works, one of the events should be ''Got New Data''. I''ve have miserable experiences with VB events (they never seem to work).
3) Loop?
And 3k for 1 variable is ungodly huge.
Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
listen
the send function returns how many bytes has been just sent
so all you have to do is:
assume the str is an array of chars
i = 0;
while(i < strlen(str))
i += send(s, &str, strlen(str) -i, 0);
something like that
hope you got it
good luck
Arkon
[QSoft Systems]
the send function returns how many bytes has been just sent
so all you have to do is:
assume the str is an array of chars
i = 0;
while(i < strlen(str))
i += send(s, &str, strlen(str) -i, 0);
something like that
hope you got it
good luck
Arkon
[QSoft Systems]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement