Skip to content

manucabral/winsock-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winsock Code Example

Socket programming code example written in C, only works in Windows.

Installation

Clone repository

git clone --recursive https://github.com/manucabral/winsock-example.git
cd winsock-example

Usage

Makefile

Build in command line with make

make

Run server and client in two different terminals

make run_server ip=127.0.0.1 port=8888
make run_client ip=127.0.0.1 port=8888

Manually

Compile using gcc

gcc windows_client.c -lws2_32 -o windows_client
gcc windows_server.c -lws2_32 -o windows_server

Run server and client in two diferent terminals

windows_client 127.0.0.1 8888
windows_server 127.0.0.1 8888