PC Review


Reply
Thread Tools Rate Thread

Need help with IO Completion ports...

 
 
Gordon Scott
Guest
Posts: n/a
 
      13th Apr 2004
Hi there, Hopefully someone can point me to the correct newsgroup if this
one is incorrect.

I need some help with IO Completion ports.

I am trying to develop a streaming socket server than can handle 10K
simultaneous open sockets.
My first attempt was pretty vanilla C using ::select() on a large list of
sockets. I figured I could get
better performance out of IO Completion ports.

Everything seems to run fine for a few clients, once I reach around 500
clients, the call to CreateIoCompletionPort()
to accept a new client fails and returns an error code = 6.

I have no idea what the error code means. Is there some 512 limit for
sockets on an open completion port?
Any help would be great,

Thanks,
Gordon
(E-Mail Removed)



 
Reply With Quote
 
 
 
 
Alan Illeman
Guest
Posts: n/a
 
      14th Apr 2004

"Gordon Scott" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there, Hopefully someone can point me to the correct newsgroup if this
> one is incorrect.
>
> I need some help with IO Completion ports.
>
> I am trying to develop a streaming socket server than can handle 10K
> simultaneous open sockets.
> My first attempt was pretty vanilla C using ::select() on a large list of
> sockets. I figured I could get
> better performance out of IO Completion ports.
>
> Everything seems to run fine for a few clients, once I reach around 500
> clients, the call to CreateIoCompletionPort()
> to accept a new client fails and returns an error code = 6.
>
> I have no idea what the error code means. Is there some 512 limit for
> sockets on an open completion port?
> Any help would be great,
>
> Thanks,
> Gordon
> (E-Mail Removed)


CICP returns NULL on failure. If GetLastError() returns '6', I think
it's 'invalid handle' - check with MSDN

 
Reply With Quote
 
Gordon Scott
Guest
Posts: n/a
 
      14th Apr 2004
I was freeing the HANDLE returned from CreateIOCompletion port, for an
individual socket when there was an error,
turns out that freeing that handle seemd to disrupt the entire IOCP. So
the '6' error code is fixed,

however I am still getting read/write errors when handling around 500
concurrent sockets. I'm hitting some kind of saturation point I think.
I'm going to try upping the number of IO threads in the creation of the
completion port to see if that helps. Should I be setting any particualar
socket options for this type of application? Right now I am setting only
TCP_NODELAY.
Would using non-blocking sockets with IOCP gain me anything? Perhaps my IO
threads are being bogged down by blocking sends?



"Alan Illeman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Gordon Scott" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi there, Hopefully someone can point me to the correct newsgroup if

this
> > one is incorrect.
> >
> > I need some help with IO Completion ports.
> >
> > I am trying to develop a streaming socket server than can handle 10K
> > simultaneous open sockets.
> > My first attempt was pretty vanilla C using ::select() on a large list

of
> > sockets. I figured I could get
> > better performance out of IO Completion ports.
> >
> > Everything seems to run fine for a few clients, once I reach around 500
> > clients, the call to CreateIoCompletionPort()
> > to accept a new client fails and returns an error code = 6.
> >
> > I have no idea what the error code means. Is there some 512 limit for
> > sockets on an open completion port?
> > Any help would be great,
> >
> > Thanks,
> > Gordon
> > (E-Mail Removed)

>
> CICP returns NULL on failure. If GetLastError() returns '6', I think
> it's 'invalid handle' - check with MSDN
>



 
Reply With Quote
 
Alan Illeman
Guest
Posts: n/a
 
      15th Apr 2004
There is a C example at . . .
http://msdn.microsoft.com/library/de...us/fileio/base
/reading_asynchronously_with_io_completion_ports.asp

.. . . where the user creates the file handle and passes it to CICP. Not
exactly your program but it may help. I haven't used this function,
as yet.


"Gordon Scott" <(E-Mail Removed)> wrote in message
news:ex#(E-Mail Removed)...
> I was freeing the HANDLE returned from CreateIOCompletion port, for an
> individual socket when there was an error,
> turns out that freeing that handle seemd to disrupt the entire IOCP. So
> the '6' error code is fixed,
>
> however I am still getting read/write errors when handling around 500
> concurrent sockets. I'm hitting some kind of saturation point I think.
> I'm going to try upping the number of IO threads in the creation of the
> completion port to see if that helps. Should I be setting any

particualar
> socket options for this type of application? Right now I am setting only
> TCP_NODELAY.
> Would using non-blocking sockets with IOCP gain me anything? Perhaps my IO
> threads are being bogged down by blocking sends?
>
>
>
> "Alan Illeman" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > "Gordon Scott" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi there, Hopefully someone can point me to the correct newsgroup if

> this
> > > one is incorrect.
> > >
> > > I need some help with IO Completion ports.
> > >
> > > I am trying to develop a streaming socket server than can handle 10K
> > > simultaneous open sockets.
> > > My first attempt was pretty vanilla C using ::select() on a large list

> of
> > > sockets. I figured I could get
> > > better performance out of IO Completion ports.
> > >
> > > Everything seems to run fine for a few clients, once I reach around

500
> > > clients, the call to CreateIoCompletionPort()
> > > to accept a new client fails and returns an error code = 6.
> > >
> > > I have no idea what the error code means. Is there some 512 limit for
> > > sockets on an open completion port?
> > > Any help would be great,
> > >
> > > Thanks,
> > > Gordon
> > > (E-Mail Removed)

> >
> > CICP returns NULL on failure. If GetLastError() returns '6', I think
> > it's 'invalid handle' - check with MSDN
> >

>
>


 
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
IO Completion Ports - VS C++ 6/VS .NET C++/C# andy Microsoft VC .NET 1 12th Jan 2004 02:47 AM
IO Completion Ports - VS C++ 6/VS .NET C++/C# andy Microsoft Dot NET Framework 1 12th Jan 2004 02:47 AM
IO Completion Ports - VS C++ 6/VS .NET C++/C# andy Microsoft VC .NET 0 12th Jan 2004 02:15 AM
IO Completion Ports - VS C++ 6/VS .NET C++/C# andy Microsoft Dot NET Framework 0 12th Jan 2004 02:15 AM
IO Completion Ports - VS C++ 6/VS .NET C++/C# andy Microsoft Dot NET 0 12th Jan 2004 02:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 PM.