I've progressed to the point where ENET is communicating between a client and server, but I am having problems understanding how to properly identify multiple peers running on the same remote server.
Specifically, my design calls for a threaded server to manage multiple jobs
running on remote hosts. Each job is a separate entity, and is kicked off by
the enet server. I need to keep track of them separately, as they provide
status information to the host as they run, and the host provides additional
instructions as necessary.
I am already adding information in the packet that contains a unique job number
and ID string that is passed to the remote host when the job kicks off, so this
insures that when/if the enet server goes down, it can be restarted and the
running jobs can re-establish themselves.
So, how do I properly identify the individual peers running on the remote
systems when I get an ENET_EVENT_TYPE_CONNECT, and use the
The host is bound to ENET_HOST_ANY, at UDP port #4079.
I have no problems enumerating the ENetPeer structure and checking against
duplicate ids, but since each job has the same host & port, then I don't know
best way to handle this?
Do I give each job a unique channel number? Or is the peer.sessionID going to
always be unique and constant until the connection is closed? The
outgoingPeerID & incomingPeerID are zero when the peer tries to connect, so
they aren't of any use.
The other issue I have is I would like to use the enet_list_* functions because
they are a little more elegant than maintaining a array, but I need a little
help using it as I am using C, not C++ and would love to see how to learn this
technique.
for (;;) {
if (enet_host_service(server,&event,1000) > 0) {
switch (event.type) {
case ENET_EVENT_TYPE_CONNECT:
index= FindPeerIndex(
Thanks
david @ santoolsDOTcom
<<winmail.dat>>
_______________________________________________ ENet-discuss mailing list [email protected] http://lists.cubik.org/mailman/listinfo/enet-discuss
