Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
TCP file upload server client example
1. Huma Chaudhry ME111012
Nima bahrami ME101004
1
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
2. Some Important
Terms:
socket
Stream:
a host-local,
Listen: Server does the
Listening at a port for application-created,
you OS-controlled interface
Port: 65535 ports (a “door”) into which
application process can
Socket: a door
between application both send and
process and end-end- receive messages to/from
transport protocol another application
(UCP or TCP) process
Try-Catch
Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 2
3. Overview of Client/Server interaction
TCP
create socket,
port=xyz, for
incoming request:
welcomeSocket =
ServerSocket()
TCP create socket,
wait for incoming
connection request connection setup connect to hostid, port=x
clientSocket =
connectionSocket =
welcomeSocket.accept() Socket()
send request using
read request from clientSocket
connectionSocket
write reply to
connectionSocket read reply from
clientSocket
close
connectionSocket Close req
3 clientSocket
Huma Chaudhry(ME111012), Nima Bahrami(ME101004)
4. controlled by
controlled by process application
application process
developer
developer socket socket
TCP with TCP with controlled by
controlled by
buffers, operating
operating buffers, internet system
system variables variables
host or host or
server server
Huma Chaudhry(ME111012), Nima Bahrami(ME101004) 4