Skip to content
 
 

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Ex1-Echoserver

Echo server and client using python socket

AIM:

To develop a simple webserver to serve html programming pages.

DESIGN STEPS:

Step 1:

Design of echo server and client using python socket

Step 2:

Implementation using Python code

Step 3:

Testing the server and client

PROGRAM:

CLIENT:

import socket
HOST, PORT = '127.0.0.1', 65432
with socket.create_connection((HOST, PORT)) as s:
    s.sendall(b'Naresh kumar R, 212224040213')
    print(f'Received: {s.recv(1024)!r}')

SERVER:

import socket
host,port='127.0.0.1',65432
with socket.create_server((host,port))as s:
    conn,addr=s.accept()
    with conn:
        print(f'connected by {addr}')
        while data :=conn.recv(1024):
            conn.sendall(data)

OUTPUT:

CLIENT:

image

SERVER:

image

RESULT:

The program is executed successfully

About

Echo server and client using python socket

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors