Git Product home page Git Product logo

abstractsockets's Introduction

AbstractSockets

My proposal is to program a library (.h / .c file) which will present the programmer with abstract functions for communication over sockets. The library will handle the connections, clients and server internally and provide the programmer with an easy-to-use interface for common types of communication tasks like sending messages, transferring files, etc. The library will handle the following things internally:

  • Starting and supervising running server
  • Establish and administer connections to already running servers
  • Maintain connections, handle loss of connection appropriate
  • Handle incoming connections
  • Use own application layer protocol for
    • administrative overhead
    • sending ASCII (human readable data, e.g. messages)
    • sending binary files (TODO)
      • unlimited size
      • handle file transfer
      • file transfer should not block other communication

Server functionality:

int AS_ServerIsRunning(int port);       // returns 1 if an AS_Server is running in this process on this port, otherwise 0
int AS_ServerPrintRunning();            // prints a list of all running AS_Server in this process to stdout
int AS_ServerStart(int port, int IPv);  // start ASServer at specific port
                                        // IPv can be AS_IPv4, AS_IPv6 or AS_IPunspec
int AS_ServerStop(int port);            // stop ASServer if running

Client functionality:

int AS_ClientConnect(char* host, char *port); // establish a connection to an AS_Server at [host]:port, returns connection id: cid
int AS_ClientDisconect(int conID);            // disconnects from an AS_Server previously connected with AS_ClientConnect
AS_ClientEvent_t* AS_ClientEvent(int conID);  // listen to socket and return NULL or an even structure
int AS_ClientSendMessage(int conID, int recipient, char *message);
int AS_ClientListClients(int conID);          // ask server for a list of all connected clients

In addition, a simple server/client pair using ASLib.o will demonstrate Abstract Sockets in action.

abstractsockets's People

Contributors

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