| | |
WinSocket question
Please support our C++ advertiser: Intel Parallel Studio Home
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
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






