Windows Socket (Winsock2)
Unix Server
- On STU.ipv6.club.tw, download "server.c" with
-
wget http://course.ipv6.club.tw/VoIP.1031/server.c
- Compile it with
- clang -o server.exe server.c
- Run it with
Windows Client
- Download a client program for Winsock2.
- Compile it successfully.
- Press Alt-F7 to configure project properties.
Modify "Configuration Properties - Debugging - Command Argument" as
"STU.ipv6.club.tw".
- Press Ctrl-F5 to run the program. You can see that messages was
sent and received between the client and the server.
Windows Server
- Download a server program for Winsock2.
- Compile it successfully.
- Press Ctrl-F5 to run the program. Now it is waiting a client to
send a message.
- Note that your firewall may request you to allow this connection
when you run the server program.
- Start a command window by pressing Window-R and run the command
"cmd". Then use the command "ipconfig" to find out the IP address of
your Windows. (Assume it is 1.2.3.4)
Unix Client
- On STU.ipv6.club.tw, download client.c and compile with
the command
- clang -o client.exe client.c
- Run the program by "./client.exe 1.2.3.4 12345". Input any
message such as "Good Evening".
- You can see that the server receives this message and send back a
response.
References
- Porting
TCP/IP software to Win32.