Skip to content

TCP server in c language client disconnect detection and restart new server

Notifications You must be signed in to change notification settings

novice1011/tcp-server-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TCP server C

TCP server using c language, also equipped with reconnect when client disconnect

This code is only for receiving message from client. Also, this code using blocking read mode

If you want non-blocking read on server side, use:

int connfd = accept4(sockfd, (SA*)&cli, &len, SOCK_NONBLOCK);

and this is for the client side

int sockfd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);

About

TCP server in c language client disconnect detection and restart new server

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published