The server open socket, using WINSOCK, and with while(TRUE) is always in listening mode to socket, in order to wait a connection from client. The server sends a GREETING to client. The server receive a GREETING by client and saves the message in connection.txt file. If file doesn't exists, server creates its.
Socket example and other information
Code Block with GCC G++ compiler and GDB debugger Official
Code Block with GCC G++ compiler and GDB debugger Direct Download
- Install CLion
-
Create new student account https://www.jetbrains.com/student/ or https://www.jetbrains.com/shop/eform/students
-
Insert your university email
-
Download the IDE
-
Download the code as ZIP
-
Extract zip in a folder
-
Import project as "New CMake Project from Source". Chose and select the project, navigating inside your file system. Fianlly import as "Open Existing Project".
-
Download and install MinGW-w64
-
Set Toolchains. File -> Settings -> Build, Execution, Deployment -> Toolchais. Click on '+'. Automatically, CLion sets up toolchains
- Install CodeBlocks
-
Use Code Block with GCC/G++ compiler and GDB debugger (Direct Download) link
-
Install application
-
Set up linker: Settings -> Compiler -> Linker settings -> Add
-
Add C:\windows\system32\wsock32.dll libraries
- You can click on "Build and Run" button to launch server
- You can run application from file system
- NMAP TOOL Download nmap for Windows platform, clicking on Latest stable release self-installer, from the follow link Open new terminal session and launch the follow command
ncat 127.0.0.1 8010
Write your messages from server and press ENTER to send to server.
- USE CLIENT PROGRAM Download, compile, build and run the WINSOCK CLIENT program, written in C, which is available in WINCLIENTSOCKET repository, link
- Benedetto Marco Serinelli - Initial work
The code was developed with CLion and another test was done with Code Blocks.