Giter Club home page Giter Club logo

bhaskartrivedi / clientserver Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 20 KB

With high computational power and distributed system, inter process communication has become very critical to success of your complete model design. Often student get confuse with basic communication procedure. In this example I created IPC between client and server and performed the file upload, download,rename or delete operation on server. I created wrapper to create client, server and file handling so it will be easy for student to modified it for their own purpose.

C++ 94.27% C 2.35% Makefile 3.38%

clientserver's Introduction

With high computational power and distributed system, inter process communication has become very critical to success of your complete model design. Often student get confuse with basic communication procedure. In this example I created IPC between client and server and performed the file upload, download,rename or delete operation on server. I created wrapper to create client, server and file handling so it will be easy for student to modified it for their own purpose.

Server wrapper
Server is responsible to create a server and perform the server related task. server.h and server.cpp create the server wrapper. Server Operation

  1. Opensocket : Perform the open socket operation
  2. BindSocket : Bind server using bind API call
  3. ListenSenver : Initiate Listen
  4. Acceptserver : Accept any incoming request
  5. SendServer : Send message from server to client
  6. ReceiveServer : Receive message from client
  7. CloseSocket : close client at end of communication


Client Wrapper:
1) OpenSocket : Open socket
2) GetHost : Get host to connect with
3) ClientConnect : Connect client to server
4) ClientWrite : Write data for server
5) ClientRead : Read data from server
6) CloseSocket : close client at end of communication


File handling wrapper
1) OpenFile : Open file for basic operation
2) CloseFile : close file after successful operation
3) ReadFile : Read file data
4) WriteFile : Write data to file
5) RemoveFile : Delete file
6) RenameFile : Create and rename old file to new file


To runcode
1) download file to ubuntu machine
2) run make file from server abd client directory
execute make
make
g++ -g -c CFileReading.cpp
g++ -g -c CServer.cpp
g++ -g -c ServerMain.cpp
g++ -g -o server CFileReading.o CServer.o ServerMain.o


3) run ./server and ./client

Watch Video here

clientserver's People

Contributors

bhaskartrivedi avatar

Stargazers

Eason Wang avatar

Watchers

James Cloos 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.