190 likes | 195 Views
The Transport Layer Socket Programming. CE 306. Application to TCP Interface. process sends/receives messages to/from its socket. Berkley Socket Primitives for TCP. TCP Socket: Overall Structure. UDP Socket: Overall Structure. Bridge Between App and TCP. Binding to Server.
E N D
Application to TCP Interface process sends/receives messages to/from its socket
TCP: Simple ECHO Client #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h>
TCP: Simple ECHO Server #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h>