By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

Socket Error on instantiation

P: n/a
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

Sep 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"OJ" <of****@gmail.comwrote
[WinSock Error]
ErrorCode 10042 int
Google quickly tells us what's going on:
http://kb.globalscape.com/article.aspx?id=10140

Bad protocol option.
An unknown, invalid or unsupported option or level was specified in a
getsockopt or setsockopt call.
--
Chris Mullins
Sep 4 '06 #2

P: n/a
OJ
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-
Chris Mullins wrote:
"OJ" <of****@gmail.comwrote
[WinSock Error]
ErrorCode 10042 int

Google quickly tells us what's going on:
http://kb.globalscape.com/article.aspx?id=10140

Bad protocol option.
An unknown, invalid or unsupported option or level was specified in a
getsockopt or setsockopt call.
--
Chris Mullins
Sep 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.