CLIENT SERVER COMMUNICATION
USING TCP IN PYTHON
-Vandana Garia
1
CONTENTS
01 INTRODUCTION
02 OBJECTIVES
03 METHODOLOGY
O4 WORK-FLOW
DIAGRAM
05 FUTURE SCOPE
06 REFERENCES
2
01 INTRODUCTION
1.1 Socket programming is a way of connecting two nodes on a
network to communicate with each other. One socket(node) listens
on a particular port at an IP, while the other socket reaches out to the
other to form a connection. A socket is one endpoint of a two
way communication link between two programs running on the
network. The socket mechanism provides a means of inter-process
communication (IPC) by establishing named contact points between
which the communication takes place.
1.2 Socket are generally employed in client server applications. The
server creates a socket, attaches it to a network port addresses then
waits for the client to contact it. The client creates a socket and then
attempts to connect to the server socket. When the connection is
established, transfer of data takes place.The server forms the listener
socket while the client reaches out to the server.
They are the real backbones behind web browsing. In simpler terms,
there is a server and a client.
3
1.3 A server is a software that waits for client requests and serves or
processes them accordingly. A server is a program that runs on the
remote machine providing services to the clients.
1.4 A client is requester of this service. A client is a program that runs
on the local machine requesting service from the server. A client
program request for some resources to the server and server
responds to that request.
4
02 OBJECTIVES
5
2.1 The main purpose of this project is to develop a secure Server Client
communication in same network.
2.2 To establish two way communication(Full Duplex).
03 METHODOLOGY
6
3.1 Socket programming
Sockets can be thought of as endpoints in a communication channel that is bi-
directional, and establishes communication between a server and one or more
clients. Here, we set up a socket on each end and allow a client to interact with other
clients via the server. The socket on the server side associates itself with some
hardware port on the server side. Any client that has a socket associated with the
same port can communicate with the server socket
7
3.2 Multi-Threading
A thread is sub process that runs a set of commands individually of any other thread.
So, every time client connects to the server, a separate thread is created for every
instance and communication from server to client takes place along individual threads
based on socket objects created for the sake of identity of each client.
We will require two scripts to establish this communication. One to keep the serving
running, and another that client should run in order to connect to the server.
8
3.3 Server Side Script
The server side script will attempt to establish a socket and bind it to an IP address
and port specified by the user .
3.4 Client Side Server
The client side script will simply attempt to access the server socket created at the
specified IP address and port.
9
SERVER AND CLIENT CHATBOX
10
04 WORK-FLOW DIAGRAM
05 FUTURE SCOPES
11
5.1 If developed further by adding a database, frontend and buying a server
place on the internet, this project can be converted into a real time chat
application.
5.2 More graphical interfaces can be added.
06 REFERENCES
12
6.1 https://www.tutorialspoint.com/python/python_networking.htm
6.2 https://www.geeksforgeeks.org/simple-chat-room-using-python/
Thank You !!

CLIENT SERVER COMMUNICATION.pptx

  • 1.
    CLIENT SERVER COMMUNICATION USINGTCP IN PYTHON -Vandana Garia 1
  • 2.
    CONTENTS 01 INTRODUCTION 02 OBJECTIVES 03METHODOLOGY O4 WORK-FLOW DIAGRAM 05 FUTURE SCOPE 06 REFERENCES 2
  • 3.
    01 INTRODUCTION 1.1 Socketprogramming is a way of connecting two nodes on a network to communicate with each other. One socket(node) listens on a particular port at an IP, while the other socket reaches out to the other to form a connection. A socket is one endpoint of a two way communication link between two programs running on the network. The socket mechanism provides a means of inter-process communication (IPC) by establishing named contact points between which the communication takes place. 1.2 Socket are generally employed in client server applications. The server creates a socket, attaches it to a network port addresses then waits for the client to contact it. The client creates a socket and then attempts to connect to the server socket. When the connection is established, transfer of data takes place.The server forms the listener socket while the client reaches out to the server. They are the real backbones behind web browsing. In simpler terms, there is a server and a client. 3
  • 4.
    1.3 A serveris a software that waits for client requests and serves or processes them accordingly. A server is a program that runs on the remote machine providing services to the clients. 1.4 A client is requester of this service. A client is a program that runs on the local machine requesting service from the server. A client program request for some resources to the server and server responds to that request. 4
  • 5.
    02 OBJECTIVES 5 2.1 Themain purpose of this project is to develop a secure Server Client communication in same network. 2.2 To establish two way communication(Full Duplex).
  • 6.
    03 METHODOLOGY 6 3.1 Socketprogramming Sockets can be thought of as endpoints in a communication channel that is bi- directional, and establishes communication between a server and one or more clients. Here, we set up a socket on each end and allow a client to interact with other clients via the server. The socket on the server side associates itself with some hardware port on the server side. Any client that has a socket associated with the same port can communicate with the server socket
  • 7.
    7 3.2 Multi-Threading A threadis sub process that runs a set of commands individually of any other thread. So, every time client connects to the server, a separate thread is created for every instance and communication from server to client takes place along individual threads based on socket objects created for the sake of identity of each client. We will require two scripts to establish this communication. One to keep the serving running, and another that client should run in order to connect to the server.
  • 8.
    8 3.3 Server SideScript The server side script will attempt to establish a socket and bind it to an IP address and port specified by the user . 3.4 Client Side Server The client side script will simply attempt to access the server socket created at the specified IP address and port.
  • 9.
  • 10.
  • 11.
    05 FUTURE SCOPES 11 5.1If developed further by adding a database, frontend and buying a server place on the internet, this project can be converted into a real time chat application. 5.2 More graphical interfaces can be added.
  • 12.
    06 REFERENCES 12 6.1 https://www.tutorialspoint.com/python/python_networking.htm 6.2https://www.geeksforgeeks.org/simple-chat-room-using-python/
  • 13.