Giter Site home page Giter Site logo

nwp-project2-udp-sockets's Introduction

Simple UDP Client Server Application

logo_c

Features :

  • The client program reads input from user and performs the following actions repeatedly until directed to exit:

  • If the user enters 's', it will ask user to enter a string. It then sends "xxx\n"to the server(where "xxx" is the string entered by the user, which could includeany character except"\n"), and receives a message from the server and displaythe message on the screen.

  • If the user enters 'q', it will exit

  • If the user enters anything else, it will ignore

  • If it receives a message from the server at any time, it will print the received message in a new line.

  • It will automatically send"\n" to the server every 5 seconds.S

  • The server program performs following operations:

  • Whenever a message that is not "\n"is received from a client, the server sends the same message back to all known active clients(i.e. the clients that the server has received messages fromwithin the past 15 seconds), including the one the message is received from.

To Build client and server program:

$ cd nwp-project2-udp-sockets/client
$ make
$ cd nwp-project2-udp-sockets/server
$ make

Run make clean in client and server directories to clear the compiled binaries.

To Run:

Run client as:

$ cd nwp-project2-udp-sockets/client
$ ./client.out xxx.xxx.xxx yy

Run server as:

$ cd nwp-project2-udp-sockets/server
$ ./server yy

Where xxx.xxx.xxx is the server IP address and yy is the port number. To use the client software, just press 's' and enter. Then type in the desired string and press enter again.

Assumptions:

  • Maximum number of client connections allowed is defined
  • Maximum length of message to be exchanged is defined
  • These macros are defined in respective helper.h files

nwp-project2-udp-sockets's People

Contributors

asishadhikari 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.