0% found this document useful (0 votes)
11 views3 pages

Socket Connection Doc1

The document discusses setting up a socket connection between a client and server for scanning and transmitting image files. The client scans an image using a python library, saves it locally, and sends it to the server via socket. The server receives the image and stores it in a database.

Uploaded by

elcinjayaraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Socket Connection Doc1

The document discusses setting up a socket connection between a client and server for scanning and transmitting image files. The client scans an image using a python library, saves it locally, and sends it to the server via socket. The server receives the image and stores it in a database.

Uploaded by

elcinjayaraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.Install Scanner driver in client machine.

2.Using socket Connection Client Server Communication:

After socket connection finding the scanner connected to the local machine using
python sane library and capture the image and save it to desktop location and then
send it to server through socket connection.

Socket:
Socket is essentially an end-point of a two-way communication link. It is identified by IP
address and the port number. The sockets should be properly configured at both ends so that it
initiates a connection, makes it possible to listen for incoming messages and then send the
responses at either ends of a client-server environment.

Client Hostname is : dexra38


Client(IP- localhost or 127.0.0.1) also it has (192.168.1.25): socket is set up on the
client end. It mainly send connection request to server socket listening at its IP address and port
number.

Methods: connect()
obj=socket.socket()
obj.connect((host,port))

This method takes IP address and port number of the server.


Once connection is accepted by the server, both the socket objects can send and/or
receive data. send():
The server sends data to client by using the address it has intercepted.
client.send(bytes)

Client socket sends data to socket it has established connection with.

obj.send(bytes)

recv():

This method is used to retrieve data sent to the client. In case of server, it uses the remote
socket whose request has been accepted.

Server (IP-127.0.1.1) with this IP everything works fine.


If we change to (193.117.238.13), ie IP of UAT Server, with this IP connection
refused, we checked.
We also checked thru telnet as below, connection could not be established.

bind():
This method binds the socket to specified IP address and port number.
listen():
This method starts server and runs into a listen loop looking for connection request from
client.
accept():
When connection request is intercepted by server, this method accepts it and identifies the
client socket with its address.

3.After receving data from client update the image to Server Database.

Once the connection is established, the client sends the data stream received
from scanner, to server for storing it in server.

Ref Link: https://www.knowledgehut.com/tutorials/python-tutorial/python-socket-


module https://stackoverflow.com/questions/42458475/sending-image-over-sockets-
only-inpython-image-can-not-be-open

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy