-
I just don't get it!!
I have a program that contains three winsockets. Two go to a Win98 machine and the other to a Linex box. If I have only the Linex port connected the program works fine. As soon as I connect with the Win98 machine, the data arrival event of the Linex port is no longer called (although the two Win98 ports work great).
There is no way around it! I need all three. Anyone understand this problem??
-
i assume you have the three winsock local ports different.
Have you checked to make sure your not losing your winsock control? Throw a debug print in the close event of the winsock controls.
I had a problem similiar to this when making a ftp control. For some reason still unbeknown to me, windows chose to close a socket early before another socket recieved all of its data.
-
not sure if this will help
helped me with a similar problem
try this....
winsock.getdata inbuffer
' then use a dovents
DoEvents
' before doing anything else
' try one before the getdata line also
also are you using an array of 3 winsocks or 3 seperate ones?
since you are using linux can you check out my recent question
http://forums.vb-world.net/showthrea...threadid=24809
-
I tried putting a breakpoint in the close event. Unfortunatly it didn't work. Good suggestion though!
I am using Three separate Winsockets. I have tried using the doevents. I've repositioned them everywhere! I cannot find a combination of them that will work.
This one is a mystery. And documentation is definitly limited!
-
What about sleeps?
I made a telnet control where I couldnt figure out why my dataarrival was not getting kicked off, I threw a sleep(200) call in, with a do events in front and behind, and it worked.
I wouldnt recommend having this in there for it is not good programming practice, but use it to help try and debug. It helped point me to the area which was causing me to miss my arrival.
FYI: Sleep is an api call, which you pass the number of milliseconds i believe for which you want to wait.
-
Well I was hopeing that the sleep would work, but it didn't. Another good suggestion though. By the way where in your program did you add the sleep? I think I put it in a correct spot, but who knows...
-
I put the sleep after i sent a command to a unix box.
Mmmmmm.
So lets review.
You have 2 win98 machines and a Linux box. you wish for one win98 machine to connect to a linux box and the other win98 machine. Separtely the connections work good, once you connect to the 98, the linux winsock data_arrival does not seem to fire....
What happens if you connect to the 98 first then the linux box?
-
Well it took a bit of manipulating, but I did try to connect the Win98's first and then to the Linux box. The exact same behavior! Data Arrival (Linux) was called Approx. three times before quitting, although the Win98 sockets remain working great.
-
do you have a proggie on the linux box with which you are trying to connect to? or are you trying to connect to a protocol? such as http on 80, or telnet on 23, or ftp on 21?
The wierd thing about this, is that the two winsocket's are unrelated, one does not know the other exists nor should it care. One is going to 98, the other to linux. That is why I thought for sure, the local ports of the two winsocket were the same, which would not be good.
I am sure you know this but just to make sure, for both winsocket, you are setting the local port to different numbers for both winsockets? They should also be not lower then 1000.
-
Another day, same problem... :-)
Well I'm not sure what you mean by a proggie, but I am not connecting with a protocal of any kind. It is an internal network, and the three computers are all on the same desk.
I knew all the ports were different, but when you mentioned it I double checked. They are 8833, 8820, and 8850.
-
sorry proggie has beeing a program.
are you connecting to a program on the linux and 98 boxes?
-
are you using TCP or UDP, also did you hard code the ports or let the OS choose them by setting the local port to 0 in the properties
-
I am connecting to a program on both machines. I did both the Win98 ones and my coworker has coded the Linux part. We are currently using TCP, but thinking of switching to UDP because of its speed.
We now actually have a working program!! By slowing down the rate that the Linux box was sending data, it worked. I guess we were flooding the data_arrival buffer? Although sending data at a faster rate would be preferable, it is nice to at least have something that is working.
Thank you for all your help! It has been wonderful. I do now have yet another problem that I will be posting shortly. I'm sure it will rack your brains yet again...