Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Client - Server Chat-bot

Simple server client chat bot written in C++ adapted from workshop by ACM IIT Roorkee Student Chapter.

What does it do?

It creates a connection to the server and can send and recieve text messages.

Built With:

  • C++
  • Socket Programming

Usage:

  1. Clone the repo.
  2. Use either the TCP or UDP choose relevant directory.
  3. Open terminal and compile the files server.cpp and client.cpp
g++ server.cpp -o server
g++ client.cpp -o client
  1. Start the server on a specified port.
./server PORT
  1. In another terminal window connect the client to server.
./client localhost PORT
Sidenote:

NOTE: If you compile it on a windows machine, it might throw an error:

server.cpp:2:10: fatal error: sys/socket.h: No such file or directory
    2 | #include <sys/socket.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

This happens as:

<sys/socket.h> is for UNIX/Linux.

For windows, you use <Winsock2.h>. You'll also need to link against Ws2_32.lib and call WSAStartup to use WinSock.

Acknowledgments:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages