Re: More IOCP Winsock!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Ah, ok, but how do I work with it? Do I make an array of the
PPER_SOCKET_CONTEXT? I tried that but couldnt figure it out. Im sorry im so
useless =(

"Arkady Frenkel" wrote:

That exactly g_pCtxtList list of structs PER_SOCKET_CONTEXT in
iocpserverex.h
Arkady

"Suker9" <Suker9@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0BA91A1C-0A13-4C59-A0C6-58CDDAD0C65C@xxxxxxxxxxxxxxxx
Yes, I got the standard echo server to compile. I think tweaked some
things
around and with help from you, and a few others, I can process the data
and
decide what is sent back or sent at all based on the data recieved. My
last
big problem is getting the userlist to work so I can send data to all the
clients if I want to.

"Arkady Frenkel" wrote:

Did you compile/link IOCP example successfully ? Start from it
Arkady

"Suker9" <Suker9@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FE6CBA58-91CF-4410-98C4-30D7992D5C76@xxxxxxxxxxxxxxxx
Er.. I dont know how to do this.. I always get errors, and I think it
is
irrelevant as to what errors since I'm taking pot shots. I try making
an
array of the various structs, and try using a for loop to cycle through
the
structs sending data as a test, and I can never get it to compile.



"Arkady Frenkel" wrote:

Yes, that is general way, you need to add to least when client
connected
(
accept() on server ) and when remove when client disconnected , you
chack
that when you receive error code when server send to client data
unless
you
have such format in your protocol ( client can send to client some
disconnection message )
Arkady

"Suker9" <Suker9@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7E2BD0D7-6DA8-4556-B4D9-CDF58F9BA507@xxxxxxxxxxxxxxxx
Hehe, I planned on it :D Anyway, I'm a bit confused on some things,
but I
should mess around for awhile and maybe I'll figure it out.

I'm going to reduce the threads down from 16 (standard in the
example)
and
I'll make a seperate array of the same stuct. Does that sound
right?
The
server as is echos the response back, but I've messed around with it
to
add
some parsing and data collecting, but I want to allow sending data
to
all
clients when certain data is sent, like a mock chat server.

I'll try making a whole seperate array of the structs and add to it
as
a
client is connected, and when a client disconnects, how should Igo
about
clearing it, or when I go to send all, should I check if each one is
connected, and if it isnt, close the socket and clear it?

Would a vector or map be better for this? Thanks!

"Arkady Frenkel" wrote:

BTW why not to use list of structs defined in Iocpserver.h , you
don't
need
to invent the wheel :)
Arkady

"Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx> wrote in message
news:%23u%238YrV3GHA.4976@xxxxxxxxxxxxxxxxxxxxxxx
Yes, something exactly that IOCP do. BTW the number of threads
IOCP
use
is
twice of number of processors on the computer and you don't need
to
have
it equal to socket number at all
Arkady

"Suker9" <Suker9@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68A0C9C2-A576-4274-8097-51F5C4FE9761@xxxxxxxxxxxxxxxx
How would I go about doing that?

Do I make a seperate struck as an array type ordeal and add to
it
each
time
someone connects?

"madmanahong" wrote:

you must maintain a user list.
















.



Relevant Pages

  • TCP/IP Client/Server noob question
    ... i'm a little confused how to actually send the server data, ... Client sends data. ... Client creates a byte array the size of one class object, ... Server then receives the next number of bytes for one object, decodes ...
    (microsoft.public.dotnet.csharp.general)
  • TCP/IP Client/Server question
    ... i'm a little confused how to actually send the server data, ... Client sends data. ... Client creates a byte array the size of one class object, ... Server then receives the next number of bytes for one object, decodes ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: passing a NULL pointer from vb6 to an ATL method
    ... Is all this necessary if the client and server are in the same apartment? ... Dim array as Double ...
    (microsoft.public.vc.atl)
  • Re: FILE* behaviour over BSD sockets - how?
    ... I made a server side program that executes fscanf, ... The client side prints an array from the other side of the connection, ... I thought that perhaps it's something about signals. ...
    (comp.unix.programmer)
  • Re: How to update entries in a file
    ... For those of us who write books, not everything is covered in them and hence ... The below is done using sockets and I have the server and the client working ... Why isn't line 1 passed into the array? ...
    (comp.lang.perl.misc)