If your server program opens up a socket and starts to listen on it (EG port 5000) then that port has been ''taken over''.
No other application can open it for use.
However, with this being said -- _any_ application can connect to that port. -- All the app has to do is open up a new port (such as 5001) and then use that socket to connect to the remote socket (in this case, 5000)
Your problem may be your client app is trying to utilize port 5000 for its port... which will already be in use by the server app.
May sound confusing, but if you read it over again and again till your eyes are as bloodshot as mine tend to get then it makes perfect sense
"1 is equal to 2 for significantly large quantities of 1" - Anonymous
This is what i use in my error program.
#include <winsock2.h>
and lib: Ws2_32.lib
Are they the factor make my program error?
#include <winsock2.h>
and lib: Ws2_32.lib
Are they the factor make my program error?
Yeah. My server program bind() port 5000 and currently running.
But server and client must agree the same port, right?
But server and client must agree the same port, right?
Oluseyi, I know winsock2 is the prefered socket library to use now. I''m just using winsock for learning purposes now. I do plan to move to Winsock2, though.
WinSockInit() is a wrapper function defined by me to startup winsock 1.1. It uses WSAStarup too
I don''t have a signature
WinSockInit() is a wrapper function defined by me to startup winsock 1.1. It uses WSAStarup too
I don''t have a signature
I don't have a signature
>>Yeah. My server program bind() port 5000 and currently running.
>>But server and client must agree the same port, right?
If your server program binds() to port 5000... The client program cannot create a socket on that port number.
Create one on a port like 5001.
That should solve your problem.
>>But server and client must agree the same port, right?
If your server program binds() to port 5000... The client program cannot create a socket on that port number.
Create one on a port like 5001.
That should solve your problem.
"1 is equal to 2 for significantly large quantities of 1" - Anonymous
If your server program opens up a socket and starts to listen on it (EG port 5000) then that port has been ''taken over''.
No other application can open it for use.
So you mean the client program want to take over port 5000 of server?
I checked the error 10065.
WSAEHOSTUNREACH
(10065)
No route to host.
A socket operation was attempted to an unreachable host. See WSAENETUNREACH
WSAENETUNREACH
(10051)
Network is unreachable.
A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.
WSAEHOSTUNREACH
(10065)
No route to host.
A socket operation was attempted to an unreachable host. See WSAENETUNREACH
WSAENETUNREACH
(10051)
Network is unreachable.
A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.
I don't have a signature
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement