Create Socket Error

  • Thread starter Thread starter Anony
  • Start date Start date
A

Anony

Hi All,

I'm trying to create a listener server:

IPAddress ipAddress = IPAddress.Parse("192.168.0.1");
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 9999);

Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );

Before Bind and Listen, I get exception at the Socket:

An unhandled exception of type
'System.Configuration.ConfigurationException' occurred in system.dll

Additional information: Unrecognized attribute 'value'

What's wrong with 'System.Configuration' ?
Thanks for any tip or fix.


Kind regards,
Anony
 
This seemed to work over here. Might check 192.168.0.1 is ok on your system
and port 9999 is free (however you should have gotten different exception I
think). Is this a virtual nic or something?

IPAddress ipAddress = IPAddress.Parse("192.168.0.221");
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, 9999);

Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp );
listener.Bind(localEndPoint);
Console.WriteLine("Did Bind.");
listener.Listen(100);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top