Giter Club home page Giter Club logo

nonblockingtcpserver's Introduction

NonblockingTcpServer

A simple non-blocking TCP server. This is a single threaded TCP server that does not block on I/O.

I used the select() system call over non-blocking sockets for polling for detecting socket readiness for read and write.

Long reads and writes will be done in round robin fashion: instead of finishing one long read or write in one go it will be interspered with other reads and writes. Thus no clinet connections will be starved off server attention. And there will always be some progress in terms of data reads/writes.

In the test server and clients the client sends a file name to the server. The server reads the contents of the file from the disk and writes the data back to the client. Note that this type of read-then-write operations could be done faster using the sendfile (http://linux.die.net/man/2/sendfile) system call. But we don't use that here.

nonblockingtcpserver's People

Contributors

bilash avatar

Stargazers

Hodong avatar yui​ avatar BlancosWay avatar Xudong Wang avatar cyne avatar david guimard avatar  avatar  avatar

Watchers

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