Socket Programming Flashcards
1
Q
TCP Procedure
A
Must set up connection before sending
- Create pipe
- Send data through pipe
- Close pipe
2
Q
UDP Procedure
A
Unreliable, No pipe, label each packet with destination (IP and port)
3
Q
Socket
A
Reliable, byte-stream oriented. Door between application process and end-end transport protocol
4
Q
TCP Socket Programming
A
- Server set-up (tcp and client socket)
- Client set-up (socket and server socket) sends TCP connection to server
- Server waits for TCP request, accepts client socket
- Client sends request using socket
- Server reads request from socket and sends reply to socket
- Client read reply from socket
- Both endpoints close the TCP
5
Q
UDP Socket Programming
A
- Server creates socket
- Client makes socket
- Client makes datagram (message) with server IP and port included, and sends it to server
- Server reads datagram from socket and writes reply with client IP and port to socket
- Client read reply from socket and closes socket
- Server keeps socket open