Code Monkey home page Code Monkey logo

server-client's Introduction

Aim: 
To build a simple network involving three nodes with following instructions.
1. One of the nodes will be a client and the other two nodes will be servers.

2. The client can request for a file from the servers and any server having the file will send the
file, also flag an error message if the server does not have the file. If both servers have the
file, send the file from any of the servers.


Compilation instruction
1) client server is hard coded in file itself
2) only port are provided as command line for each file
3) 2 port are provided corresponding to each server for client.c file.

----------------server1.c-------------------------------
abhaykrpt@ubuntu:~/Desktop/Server1$ gcc server1.c -o server1.out
abhaykrpt@ubuntu:~/Desktop/Server1$ ./server1.out 9092
file requested is s1_f1.txt

File  s1_f1.txt is found  in server1
 error in  openning the file
abhaykrpt@ubuntu:~/Desktop/Server1$ 


---------------------server2.c-------------------------
abhaykrpt@ubuntu:~/Desktop/Server2$ gcc server2.c -o server2.out
abhaykrpt@ubuntu:~/Desktop/Server2$ ./server2.out 9090
file requested is s2_f3.txt

File  s2_f3.txt is found  in server2
 error in opening of file!abhaykrpt@ubuntu:~/Desktop/Server2$ 



----------------client.c-----------------------------------
abhaykrpt@ubuntu:~/Desktop/client$ ./client.out 9092 9090
connected to server1
Please enter the filename to check to server1: 
s1_f1.txt
File is found at server1
please enter the local file name in which you want to save the data
localfile.txt
s2_f3.txt
File is found at server2
abhaykrpt@ubuntu:~/Desktop/client$ 

server-client's People

Contributors

kmrabhay avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.