Socket Error on instantiation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • OJ

    Socket Error on instantiation

    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(AddressF amily.InterNetw ork,
    SocketType.Stre am, ProtocolType.Tc p)

    C#
    private Socket client = new Socket(AddressF amily.InterNetw ork,
    SocketType.Stre am, ProtocolType.Tc p);

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

    + EnableBroadcast 'this.client.En ableBroadcast' threw an exception of
    type 'System.Net.Soc kets.SocketExce ption' bool
    {System.Net.Soc kets.SocketExce ption}


    and...

    - MulticastLoopba ck 'this.client.Mu lticastLoopback ' threw an exception
    of type 'System.Net.Soc kets.SocketExce ption' bool
    {System.Net.Soc kets.SocketExce ption}

    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

  • Chris Mullins

    #2
    Re: Socket Error on instantiation

    "OJ" <oferns@gmail.c omwrote
    [WinSock Error]
    ErrorCode 10042 int
    Google quickly tells us what's going on:


    Bad protocol option.
    An unknown, invalid or unsupported option or level was specified in a
    getsockopt or setsockopt call.


    --
    Chris Mullins


    Comment

    • OJ

      #3
      Re: Socket Error on instantiation

      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" <oferns@gmail.c omwrote
      [WinSock Error]
      >
      ErrorCode 10042 int
      >
      Google quickly tells us what's going on:

      >
      Bad protocol option.
      An unknown, invalid or unsupported option or level was specified in a
      getsockopt or setsockopt call.
      >
      >
      --
      Chris Mullins

      Comment

      Working...