| | |
WinSocket question
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hello,
I have a server and client file.
In Client I have
In server I have
This is same in both files:
Will this connection be established?
I have a server and client file.
In Client I have
C++ Syntax (Toggle Plain Text)
WSADATA WsaData; SOCKET Socket;
In server I have
C++ Syntax (Toggle Plain Text)
WSADATA xxx; SOCKET yyy;
This is same in both files:
C++ Syntax (Toggle Plain Text)
sock_addr.sin_port = htons(1234);
•
•
Join Date: Dec 2006
Posts: 1,089
Reputation:
Solved Threads: 164
the server will bind to an address and start listening on it. the client socket is usually dynamically bound and tries to connect to the socket at the address the server has bound. so the port the client tries to connect to should be the same as the one the server used in the call to bind.
1234 is not an ideal choice for the port though. see http://en.wikipedia.org/wiki/List_of...P_port_numbers
will this connection be established? can't say. the port may already be in use (for 1234, this is likely in windows), the connection may be blocked/dropped by a firewall etc.
1234 is not an ideal choice for the port though. see http://en.wikipedia.org/wiki/List_of...P_port_numbers
will this connection be established? can't say. the port may already be in use (for 1234, this is likely in windows), the connection may be blocked/dropped by a firewall etc.
![]() |
Similar Threads
- C command-line I/O question (C++)
- question on cooling (Cases, Fans and Power Supplies)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the C++ Forum
- Previous Thread: how to design board games in c++
- Next Thread: linking error
Views: 1666 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code compile compiler console conversion convert count data delete deploy dll dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib lines list loop looping loops map math matrix memory newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






