09-10-2012, 10:33 AM
Introduction to Socket Programming
Socket Programming.pdf (Size: 643.92 KB / Downloads: 30)
What is a Socket?
• A socket is a software endpoint that can plug into or be plugged into
to create a bi-directional communication link between software
processes
• A socket is a common interface for performing network
communication
• Underneath the hood, Android’s HTTP client library is using sockets
to send and receive data
Java Sockets
• In Java, a ServerSocket can receive new connections from a client
• A client connects to a remote ServerSocket through a standard
Socket instance
• When the server receives the connection, it talks to the client using a
standard socket
S
Internet Protocol Suite: Transport
• TCP: Transmission Control Protocol
• Byte stream transfer
• Reliable, connection-oriented service
• Point-to-point (one-to-one) service only
• UDP: User Datagram Protocol
• Unreliable (“best effort”) datagram service
• Point-to-point, multicast (one-to-many), and broadcast (one-to-all)