Download presentation
Presentation is loading. Please wait.
1
Socket Programming A review By Snehal Kale
2
What is a socket? An End Point of a 2-way Communication Link Used in Client – Server Communication Bound to a port Port 80 Port 2000 Bi-Directional Link
3
What is a socket? Used by TCP Server Socket: java.net.ServerSocket Client Socket: java.net.Socket What is a protocol? -An agreement for communication between server and client -Defined by the server
4
Steps 1.Open a Socket 2.Open an Input stream and Output Stream for the socket 3.Read from and Write to the stream according to the server’s protocol 4.Close the stream 5.Close the socket
5
Example MyServer.java authenticates Alice, Bob and Mark With server process ON, try netstat -a
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.