Client-Server chat in C++

Client-Server chat in C++

1.Client and server communication

The client sends a request, and the server returns a response. This exchange of messages is an example of inter-process communication. To communicate, the computers must have a common language, and they must follow rules so that both the client and the server know what to expect

No alt text provided for this image

2.Client-server?socket programming

Socket programming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while other socket reaches out to the other to form a connection. Server forms the listener socket while client reaches out to the server.

3.Sequence of function for?client-server?communication

No alt text provided for this image

create a client server socket connection?

  1. Create a socket with the socket() system call.
  2. Connect the socket to the address of the server using the connect() system call.
  3. Send and receive data. There are a number of ways to do this, but the simplest is to use the read() and write() system calls

Send data from client to server in socket programming?

  1. Create a socket with the socket() system call.
  2. Bind the socket to an address using the bind() system call. ...
  3. Listen for connections with the listen() system call.
  4. Accept a connection with the accept() system call. ...
  5. Send and receive data.



For?more information about this project check my article

link?https://embeddedlinux1.blogspot.com/2022/04/socket-programming-in-cc.html


** Thank you for following **?




Siddiqui Arshad hussain

Android/Linux Multimedia - Camera || AOSP || BSP || AI/ML || CDAC (PG-DESD) || ME || BE || Diploma Eng

2 年

Useful

要查看或添加评论,请登录

Belkacem Roukaya的更多文章

  • Cache Memory Positioning in an MCU

    Cache Memory Positioning in an MCU

    Introduction In a Microcontroller Units (MCUs), cache memory is strategically positioned to optimize performance by…

  • Realization of a drone tracking system

    Realization of a drone tracking system

    What is GPS ? The Global Positioning System (GPS) is a navigation system using satellites, a receiver and algorithms to…

    6 条评论
  • UART

    UART

    1.introduction to UART * Universal a Synchronous Receiver Transmitter * uses only two wires : TX to RX (each direction)…

  • IoT for kids

    IoT for kids

    A temperature alarm through Thingspeak and IFTTT Purpose of this project: With the Micro:bit board and ESP8266 module…

    1 条评论

社区洞察

其他会员也浏览了