![]() |
|
#1
|
|||
|
|||
Winsock: Bind failing for client but not serverHello,
The title pretty much explains what's happening here... When I run the program I just return my own error code of 102; which means the bind on the client portion of the engine has failed. Files networkEngine.h CPP / C++ / C Code:
networkEngine.cpp CPP / C++ / C Code:
main.cpp CPP / C++ / C Code:
I've been trying to figure this out... the server binds appropriately, which is odd. Thanks in advance, Seraphis. |
|||
|
#2
|
|||
|
|||
Re: Winsock: Bind failing for client but not serverQuote:
However... A client doesn't have to be bound to any particular port by the user. In your case, since the server and client are on the same machine, the client can not be bound to the same port that you have already committed to the server. The kernel will choose a local port for the client when the connect() function is called for with server IP address and port number. In general, we don't care what the client's local port number is. See Footnote. Bottom line: Don't call bind() for the client. Regards, Dave Footnote: If you really want to know the client's local port number you can use getsockname(): CPP / C++ / C Code:
But it's not really necessary to know this is it? Last edited by davekw7x : 30-Jun-2009 at 14:45.
|
|
#3
|
|||
|
|||
Re: Winsock: Bind failing for client but not serverHaven't touched winsock in a while... that makes sense. haha... I feel dumb now.
Thanks man for the quick response! |
|
#4
|
|||
|
|||
Re: Winsock: Bind failing for client but not serverQuote:
"Any sufficiently advanced technology is indistinguishable from magic." ---Arthur C Clarke: The third law of prediction "Any sufficiently advanced magic is indistinguishable from technology." ---davekw7x: Comments on network programming Regards, Dave |
Recent GIDBlog
Review: Gel laptop cooling pad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BarracudaDrive application server for Linksys NSLU2 | BDG | Computer Software Forum - Linux | 0 | 24-Mar-2008 15:24 |
| Named virtual host not working | Johnnyrotton | Apache Web Server Forum | 4 | 04-Sep-2007 21:32 |
| Develop a simple chat application consisting of a client and a server. HELP MEEEEEEE | elcrazy | C++ Forum | 1 | 11-Mar-2007 22:42 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 07:19 |
| Can't view pages from another machine on the Intranet | aevans | Apache Web Server Forum | 9 | 14-May-2004 03:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The