new Socket : Socket Connection : Network C# Source Code


Custom Search

C# Source Code » Network » Socket Connection »

 

new Socket








    
 

using System;
using System.Net;
using System.Net.Sockets;
class SockProp {
    public static void Main() {
        IPAddress ia = IPAddress.Parse("127.0.0.1");
        IPEndPoint ie = new IPEndPoint(ia, 8000);
        Socket test = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp);
        Console.WriteLine(test.AddressFamily);
        Console.WriteLine(test.SocketType);
        Console.WriteLine(test.ProtocolType);
        Console.WriteLine(test.Blocking);
        test.Blocking = false;
        Console.WriteLine(test.Blocking);
        Console.WriteLine(test.Connected);
        test.Bind(ie);
        IPEndPoint iep = (IPEndPoint)test.LocalEndPoint;
        Console.WriteLine(iep.ToString());
        test.Close();
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» Socket Connection