[ENet-discuss] ENet-discuss Digest, Vol 47, Issue 2

Assaf Muller assafmuller at gmail.com
Fri Apr 6 01:35:32 PDT 2007


The problem was actually that I was creating both host and peer with:


mHost = enet_host_create (& mAddress, 2, 0, 0);

while (it would seem so, and this took me 2 days of work to find out!)

that the peer side can only be created with:

mHost = enet_host_create (0, 2, 0, 0);

Or the connection will never work. Ever. This should be mentioned in the
tutorial!
On 4/5/07, enet-discuss-request at cubik.org <enet-discuss-request at cubik.org>
wrote:
>
> Send ENet-discuss mailing list submissions to
>        enet-discuss at cubik.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.cubik.org/mailman/listinfo/enet-discuss
> or, via email, send a message with subject or body 'help' to
>        enet-discuss-request at cubik.org
>
> You can reach the person managing the list at
>        enet-discuss-owner at cubik.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ENet-discuss digest..."
>
>
> Today's Topics:
>
>   1. Re:  Cannot connect to 127.0.0.1 (Lee Salzman)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 04 Apr 2007 12:56:12 -0700
> From: Lee Salzman <lsalzman1 at cox.net>
> Subject: Re: [ENet-discuss] Cannot connect to 127.0.0.1
> To: Discussion of the ENet library <enet-discuss at cubik.org>
> Message-ID: <461402DC.8010904 at cox.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Make sure you continue to service both hosts, even after connection, or
> otherwise the connection handshake will fail to complete.
>
> Lee
>
> Assaf Muller wrote:
> > Hey guys!
> >
> > Here's what I'm attempting to do: I'm creating a new game with
> > networking capabilities and I've chosen Enet for the net API. I'm
> > currently implementing the very basics, connecting, disconnecting, etc.
> > To test it I'm opening one client that listens on 127.0.0.1
> > <http://127.0.0.1> with port 50,000, and another client (simply a 2nd
> > window) that listens on 127.0.0.1 <http://127.0.0.1> and port 50,001.
> > The problem is that when the 2nd window
> > tries to connect to the 1st one, I receive no CONNECTED event for the
> > 2nd window. I use the tutorial code pretty much 1:1...
> >
> >
> > if
> >
> > (enet_host_service (mHost, &event, 5000) > 0 && event.type ==
> > ENET_EVENT_TYPE_CONNECT)
> >
> > {
> >
> > Ogre::LogManager::getSingleton().logMessage("Connected to the IP
> > specified!");
> >
> > }
> >
> > else
> >
> > {
> >
> > /* Either the 5 seconds are up or a disconnect event was */
> >
> > /* received. Reset the peer in the event the 5 seconds */
> >
> > /* had run out without any significant event. */
> >
> > enet_peer_reset (peer);
> >
> > Ogre::LogManager::getSingleton().logMessage("Could not connect to the IP
> > specified!");
> >
> > }
> >
> > Any ideas?
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ENet-discuss mailing list
> > ENet-discuss at cubik.org
> > http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
>
> ------------------------------
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
> End of ENet-discuss Digest, Vol 47, Issue 2
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cubik.org/pipermail/enet-discuss/attachments/20070406/b6078b3c/attachment.htm 


More information about the ENet-discuss mailing list