Git Product home page Git Product logo

mpwide's People

Contributors

blootsvoets avatar djgroen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mpwide's Issues

Socket::irecv / isend show faulty behavior when bufsize > MAX_INT

The status of C ::send and ::recv is read as an int, but if the buffer size is larger than that, it will deduce there is an error when there is not. In pseudo-code:

char *buf, long long int size;
int status = ::send(buf, size);
if (status < 0)
   report_error();

However, if size is larger than MAX_INT and this is successfully returned by ::send, status will be smaller than zero through casting.

I think its reasonable to assume that the input size should be an int, or that ::send will always return less than MAX_INT, but maybe an explicit comment about these assumptions would be good.

Segmentation fault on MPW_DestroyPath after failed MPW_Connect(path, false)

After a connect has failed and you try to free the resources you get a segmentation fault in DestroyPath->EraseStream if the path had multiple streams. I think the problem is that DestroyPath doesn't take into account that the stream numbers will change after calling EraseStream.

I'll try to write a patch ASAP.

MPW_SendRecv does not return an error code

This would allow error checking by the calling application. Just returning -1 is usually enough. I think a ::recv status of 0 should also be considered an error if it was successfully ::select-ed. From the recv() man page

 RETURN VALUES
 These calls return the number of bytes received, or -1 if an error
 occurred.

 For TCP sockets, the return value 0 means the peer has closed its half
 side of the connection.

Can not concurrently create path and send/receive

Possible trouble:
Segmentation fault in reading a vector in SendRecv while it is being resized.

Possible solution:
Turn vector data structures that are modified in AddStreams into arrays. This way the arrays do have to be allocated when MPWide is started (compiled), but it saves a load of trouble because they are then immutable. It is then up to users to set a sensible maximum number of streams to be used within a single session.

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.