Mina.NET icon indicating copy to clipboard operation
Mina.NET copied to clipboard

Udp Client Demo Exception

Open bobdog1986 opened this issue 10 years ago • 5 comments

First day try Mina.NET , try Udp Client Demo. But throw exception: mina-udpclient

I found 62line in code = "read = socket.EndReceiveFrom(ar, ref remoteEP);"

    private void ReceiveCallback(IAsyncResult ar)
    {
        System.Net.Sockets.Socket socket = (System.Net.Sockets.Socket)ar.AsyncState;
        Int32 read = 0;
        try
        {
            EndPoint remoteEP = Socket.RemoteEndPoint; 
            read = socket.EndReceiveFrom(ar, ref remoteEP);
        }
        catch (ObjectDisposedException)
        {
            // do nothing
            return;
        }
        catch (Exception ex)
        {
            EndReceive(ex);
            return;
        }

bobdog1986 avatar Jan 27 '16 08:01 bobdog1986

I use VS 2015, and change startup object to MemMonClient.

bobdog1986 avatar Jan 27 '16 08:01 bobdog1986

Hi~

This is because the UDP connector automatically tries to receive data from remote server, and it fails since the server (MemoryMonitor) is not started up yet. Please run the server first, everything will be on the right way.

This automation of receiving might be a feature or a bug : (. I will try to figure it out later. Thanks for your report.

longshine avatar Jan 27 '16 10:01 longshine

Hi , I just try it , your advice work! I will spend some day to learn Mina.net A suggest: Donot put two start-up object in a vs project....change project setting may cause git version different. And, update vs&.net version....

bobdog1986 avatar Jan 27 '16 15:01 bobdog1986

Thank you for your advices and interests on this project. It would be totally welcomed if you'd like to contribute.

longshine avatar Jan 27 '16 16:01 longshine

Yeah. I am working on.... Only use the demo from msdn can meet my requirement ,but not a good way. Good framework can make things better.

bobdog1986 avatar Jan 28 '16 02:01 bobdog1986