Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Inter-process Communication based on UDP Protocol

Shulou Source: shulou.com Published: 2022-06-01 01:04:01 09月27日 Update

The main features of UDP protocol are:

UDP is connectionless

UDP uses best efforts to deliver

UDP is message-oriented.

No congestion control

Support one-to-one, one-to-many, many-to-one, many-to-many interactive communication

The first part of UDP has little overhead.

The UDP protocol is connectionless and block oriented. Therefore, the client side does not need to connect with the server side, but sends messages directly.

Server: 1 # include 2 # include 3 # include 4 # include 5 # include 6 # include 7 # include 8 void usage (char * port) 9 {10 printf ("% s, [ip], [port]\ n", port); 11} 12 int main (int argc,char * argv []) 13 {14 if (argv [0]) 15 {16 usage (argv [0]); 17 exit (1) 18} 19 int sock = socket (AF_INET,SOCK_DGRAM,0); / / create socket 20 if (sock

Tags: Messages communications maximum one-to-one sockets overhead messages data features control support processes Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft MySQL macOS Shulou Technology MariaDB