Re: More IOCP Winsock!
- From: Suker9 <Suker9@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Sep 2006 17:36:02 -0700
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.
- Follow-Ups:
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- References:
- Re: More IOCP Winsock!
- From: madmanahong
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- From: Suker9
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- From: Suker9
- Re: More IOCP Winsock!
- From: Arkady Frenkel
- Re: More IOCP Winsock!
- Prev by Date: Re: Change IP without Delay
- Next by Date: Re: Service accessing mapped network drives
- Previous by thread: Re: More IOCP Winsock!
- Next by thread: Re: More IOCP Winsock!
- Index(es):
Relevant Pages
|