Beispiel #1
0
        private void ConnectAsInitiatorDirect()
        {
            // Start a listening socket and populate the DCI structure with
            // network information
            IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 0);

            _listener = new StreamSocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            _listener.Bind(ipep);

            RendezvousData rd = new RendezvousData();

            Port = (ushort)((IPEndPoint)_listener.LocalEndPoint).Port;
            _listener.Listen(1);
            _listener.BeginAccept(new AsyncCallback(AcceptConnection), rd);

            // Send the "send file" request on SNAC(04,06):02
            parent.Messages.RequestDirectConnectionInvite(this);
        }