|
-
Jul 31st, 2000, 10:01 AM
#1
Thread Starter
New Member
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??
-
Jul 31st, 2000, 10:16 AM
#2
Hyperactive Member
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.
-
Jul 31st, 2000, 10:17 AM
#3
Fanatic Member
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
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Jul 31st, 2000, 10:36 AM
#4
Thread Starter
New Member
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!
-
Jul 31st, 2000, 10:52 AM
#5
Hyperactive Member
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.
-
Jul 31st, 2000, 02:43 PM
#6
Thread Starter
New Member
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...
-
Jul 31st, 2000, 02:49 PM
#7
Hyperactive Member
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?
-
Jul 31st, 2000, 03:17 PM
#8
Thread Starter
New Member
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.
-
Aug 1st, 2000, 07:55 AM
#9
Hyperactive Member
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.
-
Aug 1st, 2000, 08:16 AM
#10
Thread Starter
New Member
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.
-
Aug 1st, 2000, 11:53 AM
#11
Hyperactive Member
sorry proggie has beeing a program.
are you connecting to a program on the linux and 98 boxes?
-
Aug 1st, 2000, 01:09 PM
#12
Lively Member
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
VB 6 Professional Edition
-
Aug 1st, 2000, 01:44 PM
#13
Thread Starter
New Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|