Git Product home page Git Product logo

socket-awaitable's People

Contributors

gro-ove avatar safakgur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

socket-awaitable's Issues

Task.Delay() ?????

Why do we have to call Task.Delay()? That make the library unreliable. I tried to send and receive messages, and since I did not use Delay, the messages that I was getting was not truly real. And I use Delay (because of the test sample) and I got the real message. This is really a big deal/issue.

Receive Timeout seem not working

Hi,

I tried to apply SocketAwaitable as a Socket Client by send & receive data to Server with 5 seconds receive timeout , below is code i using

        using (var client = new Socket(SocketType.Stream, ProtocolType.Tcp))
        {
            client.ReceiveTimeout = 5000;

            using (var connectAwaitable = new SocketAwaitable())
            {
                connectAwaitable.RemoteEndPoint = new IPEndPoint(IPAddress.Parse(_remoteIP), _remotePort);
                var connectResult = await client.ConnectAsync(connectAwaitable);
            }

            // Send.
            using (var sendAwaitable = new SocketAwaitable())
            {
                sendAwaitable.Buffer = new ArraySegment<byte>(data);

                var sendResult = await client.SendAsync(sendAwaitable);
            }

            using (var recvAwaitable = new SocketAwaitable())
            {
                recvAwaitable.Buffer = new ArraySegment<byte>(new byte[512]);
                var respResult = await client.ReceiveAsync(recvAwaitable);

                if (respResult == SocketError.Success)
                {
                    response = recvAwaitable.Transferred.Array;
                }
            }
        `}`

I tried to set server side to response socket client after 10 seconds but my socket client never throw Socket Timeout exception. Could you help to advice?

seems got connections/sockets/objects release problem

After testing with many connections, the server can not accept connections as many as it runs first time. the amount of subsequent connections depends on the total reusable SocketAwaitable minus the prior connected clients. The shutdown SocketAwaitable objects were put back to the pool.

Any ideas?

Synchronizing SendAsync

(Sorry to pose the question here as an issue if it isn't appropriate.)

I'm wondering if it's okay to call SendAsync multiple times w/o having any code to synchronize the calls. I imagine it can be an issue if I try to send a packet that is too large to be sent in 1 shot and needs to be sent in pieces while another thread is also potentially sending at the same time. Is this correct? What would be recommended approach to being able to synchronize sending?

Great work on this library btw. I've been looking for someone to explain how to properly do a single buffer/pooling and was having a tough time until I saw your project.

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.