Socket Error on instantiation

  • Thread starter Thread starter OJ
  • Start date Start date
O

OJ

Hi,
I am using windows xp sp 2 and VS2005 Express editions. Whenever I
create a new socket in either VB or C# using the following code...

VB
Private client As New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp)

C#
private Socket client = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);

....a SocketException occurs twice as such...

+ EnableBroadcast 'this.client.EnableBroadcast' threw an exception of
type 'System.Net.Sockets.SocketException' bool
{System.Net.Sockets.SocketException}


and...

- MulticastLoopback 'this.client.MulticastLoopback' threw an exception
of type 'System.Net.Sockets.SocketException' bool
{System.Net.Sockets.SocketException}

with ...

ErrorCode 10042 int



Can anyone shed some light on what is happening here? It is not raising
an Exception in my app, but it is preventing any communication using
the socket.....

Thanks,
Oli
 
Hi Chris,
thanks for the reply. I saw this too on google. This is happening when
I create a new Socket object from the Dot Net framework. I have
resolved the issue with my procedure and it now appears to work,
although the socketexception still occurs.. I think the problem is that
a TCP stream cannot broadcast like udp so tyhis is "standard"
behaviour...
O-
 

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