Skip to content

zeynepcaysar/TCP_Client_Server_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TCP Client-Server project 2022

we run the server code first and then the client code,

we enter the ip address and the port number of the server which are shown in the server's terminal. ip address:127.0.0.1 port:4455 if we enter them wrong, we have 2 more rights left.

Then, the menu appears with options like list, get file, put original file->new file, rename original file->new file and exit.

if we enter some requests that aren't list, get, put, rename or exit, we will have the message 'wrong input' in the terminal and Enter request comes again to the client terminal.

for the list request; we enter list into the client terminal, list request returns the files in the server to your computer

for file download request; we enter 'get' for the enter request and the 'file name' for the enter file name request, get file request allows us to download the wanted file from the server since client and server are the same computer in our case, for testing, when we enter get and file3.txt, we get the file under the name clicopyfile3.txt when we enter a file that doesn't exist in the server, we will get the message 'File not existing'

for file upload request; we enter 'put' for the enter request and the 'file name' for the enter file name demand, if the file doesn't exist in our computer, we get the message 'error opening file' if the file exists in the client then this question appears: uploading with new name enter yes or existing name enter no : if we answer yes, we enter the new file name for the enter new file name, for example, if we want to upload file3.txt with the name file4.txt , we enter 'file4.txt' for the new file name . the client will upload the file3.txt with the name of file4.txt. if we answer no, we wont change its name, and since server and client are the same computer in our testing case, we will get the message 'File exists in the server'.

forfile rename request; we enter 'rename' for the rename request, 'file name' for the enter file name demand and 'new file name' for the enter new file name demand. if the file exists in our computer, server prints 'The file is renamed successfully' and client prints 'renameOK' if the file doesn't exist in our computer, server prints 'error opening file' and client prints 'File not existing'

for the exit request; we enter exit client and server close the connection client prints 'Closing the connection'

About

TCP client server connection for Seminaire de programmation course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages