Re: Why TCP ECHO Not Work between distant Hosts?
- From: Norbert Unterberg <nunterberg@xxxxxxxxxxxxxxxxx>
- Date: Sun, 03 Dec 2006 10:24:20 +0100
june schrieb:
Hi! I'm June.[...]
This time I have this question:
TCP ECHO works well if I run both TCPServer.EXE and TCPClient.EXE in
the same computer.
Then TCPClient.EXE says "connect() error!"
What is wrong? I'd be grateful if you tell me:p
Why don't you ask your operating system, it has answers. Just ask it!
From the documentation of connect():
"If no error occurs, connect returns zero. Otherwise, it returns SOCKET_ERROR, and a specific error code can be retrieved by calling WSAGetLastError."
Did you call WSAGetLastError? Obiously not.
[code deleted]
*****
void ErrorHandling(char *message)
{
fputs(message, stderr);
fputc('\n', stderr);
exit(1);
}
Improve your "ErrorHandling" to do some error handing. The least you can do is read the error code with the help of WASGetLastError(), and print the code to the console. Then you can find the error text using the Error Lookup utility from your compiler.
Better yet, call the "get the error text from error code" function that Joseph Newcomer has posted several times on this list.
BTW, I assume you have the windows firewall active on your server computer, and this is blocking access from the client PC.
Norbert
.
- Follow-Ups:
- References:
- Why TCP ECHO Not Work between distant Hosts?
- From: june
- Why TCP ECHO Not Work between distant Hosts?
- Prev by Date: Encryption and some Questions...
- Next by Date: Re: Internationalizing an app
- Previous by thread: Why TCP ECHO Not Work between distant Hosts?
- Next by thread: Re: Why TCP ECHO Not Work between distant Hosts?
- Index(es):
Relevant Pages
|