-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Depending on the design of your Client/Server, the server should be
able to open the reset the port to listen mode after a connection. Or
better, revise your SERVER programs to accept multiple connection.
Here are the steps
SERVER
Initialization:
1. Create a new socket and select a port to listen to.
2. Wait for a connect event.
When connection is detected:
1. Create a new socket and accept the connection.
2. Proceed with CLIENT/SERVER conversation.
The above example is the ideal client/server setup. Which means, the
port where the SERVER is listening is NEVER closed, and all
connections to it is ACCEPTED in a different port.
Hope this helps,
Rey Arson II
Sistema Pilipinas MCMXCIII
Arson Engineering 2000
Quote:
>I have got a client/server application where the client opens a
winsock
>tcp/ip connection, writes data to the winsock and then closes the
>connection. This happens everytime the client wants to send data to
the
>server.
>The problem is that every time the client closes the TCP connection,
>the winsock in the server changes the listening port. Is there any
way
>of keeping the listening port constant so that the client always
>connects on the same port?
>I have tried to set the winsock LocalPort property to a fixed port
e.g.
>2749 but when i do this the client fails to connect again after the
>first successful connect. I get an error message saying that the
winsock
>is in the wrong state.
>Thanks for your help.
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBOBmtO0kQgOtuDKxxEQJgIwCguZcriLNIpBU5N/Z+FGVvz2E0zoAAoIBt
iuxXIlPgF8Kb4BvseHgclhXd
=/eJU
-----END PGP SIGNATURE-----
Sent via Deja.com http://www.deja.com/
Before you buy.