[Mono-bugs] [Bug 464201] Socket.BeginAccept overload doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 7 12:55:41 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=464201

User amcgovern at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=464201#c1





--- Comment #1 from Alan McGovern <amcgovern at novell.com>  2009-01-07 10:55:41 MST ---
This should compile:


using System;
using System.Net;
using System.Net.Sockets;
using System.Collections;
using System.Collections.Generic;
using System.Threading;

namespace TestCase
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            IPEndPoint ep = new IPEndPoint(IPAddress.Loopback, 10000);
            Socket accept = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
            Socket client = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
            Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);

            listener.Bind(ep);
            listener.Listen(8);
            IAsyncResult listenResult = listener.BeginAccept(accept, 0, null,
null);

            client.Connect(ep);
            Console.WriteLine("1) Accept is connected? {0}", accept.Connected);

            Socket connected = listener.EndAccept(listenResult);
            Console.WriteLine("2) Accept is connected? {0}", accept.Connected);
            Console.WriteLine(connected == accept);
        }
    }
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list