Skip to content

lala74/Socket-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Socket-cpp

Class socket in C++

Compile

With Makefile

cd Socket/
make all

With CMake

mkdir build
cd build
cmake ..
make

Execute

Target compiled by Makefile

cd Project

Target compiled by CMake

cd Project/build/bin

Execute target

# In terminal 1
./server <port>
# In terminal 2
./client <hostname|IP> <port>
# Start chatting

Type exit to stop chatting

Example

./server 8080
./client localhost 8080

We use localhost or 127.0.0.1 to chat between 2 terminals in the same laptop.

If we want to chat between 2 laptops, 2 laptops have to connect to the same wifi network and replace <hostname> = computer_name

About

Class socket in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors