PC Review


Reply
Thread Tools Rate Thread

How to create a SocketType.Seqpacket Listening Socket?

 
 
Vladimir Lushnikov
Guest
Posts: n/a
 
      29th Jul 2005
Hi,

I'm experimenting with the Seqpacket protocol, because the
connectionless protocols aren't enough for my needs, and TCP/IP doesn't
preserve message boundaries.

This is what I've currently got in C#
--------------------------------------------------------------------------
listeningSock = new Socket(AddressFamily.InterNetwork,
SocketType.Seqpacket, ProtocolType.Unknown);

// Bind to the local IP Address
listeningSock.Bind(ipLocal);

// Start listening
// WARNING - ONLY 10
listeningSock.Listen(10);

// Now begin receiving connections
listeningSock.BeginAccept(new
AsyncCallback(OnConnectionRequest), null);
--------------------------------------------------------------------------

Now that throws a SocketException at the constructor:

--------------------------------------------------------------------------
System.Net.Sockets.SocketException was unhandled
Message="An address incompatible with the requested protocol was
used"
Source="System"
ErrorCode=10047
NativeErrorCode=10047
StackTrace:
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily,
SocketType socketType, ProtocolType protocolType)

at clsServClientColClass..ctor(Int32 portNum)

at SimpleAsyncServ.frmMainSimpServ.frmMainSimpServ_Load(Object
sender, EventArgs e)

at System.Windows.Forms.Form.OnLoad(EventArgs e)

at System.Windows.Forms.Form.OnCreateControl()

at System.Windows.Forms.Control.CreateControl(Boolean
fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.WmShowWindow(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WmShowWindow(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef
hWnd, Int32 nCmdShow)

at System.Windows.Forms.Control.SetVisibleCore(Boolean value)

at System.Windows.Forms.Form.SetVisibleCore(Boolean value)

at System.Windows.Forms.Control.set_Visible(Boolean value)

at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)

at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(Form mainForm)

at SimpleAsyncServ.Program.Main()

at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)

at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)

at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)

at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()
--------------------------------------------------------------------------


I'm completely not sure on what protocol type it is supposed to use,
and I've heard the SocketType.Seqpacket uses the SCTP protocol, which
means that the address family must be InternetWork


Thanks for help,
Vladimir Lushnikov

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Stop a Listening socket? =?Utf-8?B?cm9zc3U=?= Microsoft Dot NET Framework 4 30th Jun 2006 10:03 PM
How to create a SocketType.Seqpacket Listening Socket? Vladimir Lushnikov Microsoft C# .NET 0 29th Jul 2005 04:25 PM
Thread: how to use "SocketType.Rdm" to create a socket? =?Utf-8?B?6I+c6bif5LiA5Y+qIC1fLQ==?= Microsoft Dot NET Framework 0 9th Oct 2004 03:11 AM
Close TCP/IP Listening Socket Chad Dalton Microsoft Dot NET Framework 6 12th Feb 2004 02:20 PM
Open Socket with SocketType.Raw =?iso-8859-15?Q?Stefan_P=FChringer?= Microsoft Dot NET Compact Framework 1 27th Jan 2004 03:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:27 PM.