|
-
Jun 27th, 2001, 11:48 AM
#1
Thread Starter
Hyperactive Member
winsock Problem
I have a server Application that takes connections on Port X lets say.
When I am terminating the Application I am executing the following code :
and I am looping waiting for the winsock to close
WHen I try to run the application Again. It always gives me the error Port in USe....
I have to restart for it to clear the port ... Any ideas How I can explicitely free the Port I am connecting to ?
Last edited by razzaj; Jun 27th, 2001 at 11:52 AM.
- regards -
- razzaj -
-
Jun 27th, 2001, 01:08 PM
#2
Frenzied Member
I posted an answer to your post in the other section, but after reading this description of the problem I'm not sure if your problem is on the client side or the server side.
If it is the client, are you using the same local port everytime? If so, don't assign a port. Let the system assign one for you. It won't use any that are busy.
-
Jun 29th, 2001, 06:37 AM
#3
Fanatic Member
Winsock
Winsock:
Im required to write a simple program using winsock to accept a tcp message on a certain port, log it, then fire this message out on another port.
Any ideas?? Please supply some form of code as ive never used winsock before.........examples would be greatly appreciated
-
Jun 29th, 2001, 08:17 AM
#4
Frenzied Member
It sounds like you will be receiving messages from one program and routing them to another. It this correct?
If so, your program will need at least 2 winsock controls. One will listen for connections from the sending program, connect and then accept the messages. The other will connect to the receiving program and forward the messages after they are received on the other winsock control.
I uploaded an example client/server app a couple months ago. The file is CS.ZIP and the link can be found in the post http://forums.vb-world.net/showthrea...threadid=71122
There are a lot of comments in the code to help you understand what is happening. It also describes things to be aware of when sending UDTs.
-
Jun 29th, 2001, 09:48 AM
#5
Fanatic Member
rwinsock eply to bruce
Hi Bruce
The link to the cs.zip attachment you provided does not open "Page cannot be displayed"....would it be possible for you to send me the attachment to my hotmail account [email protected]
Many Thanks for your response.
See message below:::
It sounds like you will be receiving messages from one program and routing them to another. It this correct? ....YES
If so, your program will need at least 2 winsock controls. One will listen for connections from the sending program, connect and then accept the messages. The other will connect to the receiving program and forward the messages after they are received on the other winsock control.
I uploaded an example client/server app a couple months ago. The file is CS.ZIP and the link can be found in the post http://forums.vb-world.net/showthre...&threadid=71122
There are a lot of comments in the code to help you understand what is happening. It also describes things to be aware of when sending UDTs.
-
Jun 29th, 2001, 10:21 AM
#6
Frenzied Member
Re: rwinsock eply to bruce
Originally posted by gilly
Hi Bruce
The link to the cs.zip attachment you provided does not open "Page cannot be displayed"....would it be possible for you to send me the attachment to my hotmail account
I don't know why it won't work. I had to search for messages that I posted to find it. Actually, I found another post in which I had posted the same link. That worked for me, so I copied the url and pasted it into my previous reply to you.
I also noticed that I got an error when I tried to download the file. There is a problem with that. I don't know what the problem is. I have the morning off and the file is on my office workstation. I will send you the file after lunch. I think I'll send it to myself also, so I'll have it at home.
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
|