How to use SocketType.Seqpacket?

Hi,

I was wondering how you would use SocketType.Seqpacket in a server (asynchronous non-threaded). Currently, I've got the following code:


listeningSock =newSocket(AddressFamily.InterNetwork,

SocketType.Seqpacket,ProtocolType.Unspecified);

// Bind to the local IP Address

listeningSock.Bind(ipLocal);

// Start listening

// WARNING - ONLY 10

listeningSock.Listen(10);

// Now begin receiving connections

listeningSock.BeginAccept(newAsyncCallback(OnConnectionRequest),null);


And I get the following exception on the first line of the above code:

System.Net.Sockets.SocketException was unhandled
Message="An address incompatible with the requested protocol was used"
I know that Seqpacket uses the InternetWork AddressFamily, but not sure what ProtocolType it uses, although I've heard it uses SCTP.

So how would I get this code sample to work?

Thanks for helping

[1959 byte] By [Mireno] at [2008-2-20]
# 1
It appears that you use seqpacket sockets in a device-to-device environment (not over IP), like this:

Socket sock = new Socket(AddressFamily.Unknown, SocketType.Seqpacket, ProtocolType.Unspecified);

It also appears that there is little or no documentation available beside that.

Mireno at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2
Hi Mireno,

Why do you want to use SeqPacket? SeqPacket semantics are supported only for NetBIOS. To create such a socket you should be able to use:

Socket sock = new Socket(AddressFamily.NetBios, SocketType.Seqpacket, ProtocolType.Unspecified);

Typically, NetBios is used on older OSs (such as DOS or Win95) or to connect via a network to an older device. It (NetBios) also relies on the WINS service being installed.

MikeFlasko at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified