python session 8

15
WELCOME TO PYTHON SESSION 6 WELCOME TO PYTHON SESSION 6

Upload: navaneethan-naveen

Post on 17-May-2015

52 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Python session 8

WELCOME TO PYTHON SESSION 6WELCOME TO PYTHON SESSION 6

Page 2: Python session 8

AJENDA

Socket.

Socket Programming.

What is the uses of socket in networking.

Page 3: Python session 8

What is Socket?

Sockets are the endpoints of a bidirectional communications channel.

Sockets may communicate within a process, between processes on the same machine, or between processes on different continents..

Page 4: Python session 8

Creating a socket in Client end

Page 5: Python session 8

Connect to a Server

Page 6: Python session 8

Sending Data

Page 7: Python session 8

Receiving Data

reply = s.recv(4096)

Print replay.

Page 8: Python session 8

Socket connection in servers

Programming socket servers

1. Open a socket

2. Bind to a address(and port).

3. Listen for incoming connections.

4. Accept connections

5. Read/Send

Page 9: Python session 8

Bind a socket

Page 10: Python session 8

Accept connection

Page 11: Python session 8

Single Connection

Page 12: Python session 8

Mutiple Connections

Page 13: Python session 8

Handling Connections

Page 14: Python session 8

THANK YOU

Page 15: Python session 8

Reference Link:

http://www.binarytides.com/python-socket-programming-tutorial/