Re: Winsock freezing the app
30 connections shuldn't be any problem at all using the Winsock control. I'd look elsewhere first.
Using DoEvents() calls in Winsock programming is often a sign you're doing something wrong though. If it helps at all to sprinkle them in there it sounds suspicious.
My guess would be that you are trying to blast data out over and over again (SendData calls) without waiting for SendComplete events. Without seeing some code though all we can do is guess wildly.
Re: Winsock freezing the app
wow cool answer :D
i never did implement the sendcomplete thing :O
how do i use it?
ok will send out the code ...
Re: Winsock freezing the app
SendComplete events occur as a prompt from the Winsock control telling you that there is space in the outgoing buffers for more data, and that calling SendData will not block at that point.
If you haven't written your program to work with SendComplete you may find you have some reworking to do.
Re: Winsock freezing the app
what i did is...
ON CLICK :
winsock.close
winsock.connect .....
WINSOCK CONNECT:
if state = connected then
send data
doevents
end if
WINSOCK DATAARRIVAL:
.GetData strReturn, vbString
WINSOCK CLOSE:
winsock.close
edit the recieved string.ecc
that's what i do
Re: Winsock freezing the app
Do you just do one SendData each time you Connect?
Why would you check the State in the Connect event? Seems very redundant.
There must be something else going on. I don't see anything in your psuedocode that would seem to cause your program to seize up, and calling DoEvents at the end of an event handler shouldn't do anything useful in itself. There must be a lot more going on.
Re: Winsock freezing the app
well when i connect i then choose if state=connected then send the data.
and i get the data when the winsock closes the connection