[ENet-discuss] Need help with client/server code

Nuno Silva little.coding.fox at gmail.com
Tue Oct 22 17:32:10 PDT 2013


You need the servicing on both client and server. Problem is, in the client
you're waiting for the client to type the message to send to the server, so
the servicing won't happen while the program is waiting, so it's probably
disconnecting your clients because of that. If you create a thread to take
care of ENet rather than have it on your main thread, you won't have this
problem. If you're unfamiliar with threads, you could google for C++
threads or something like that.


On Wed, Oct 23, 2013 at 1:26 AM, <stuart at semag.juplo.com> wrote:

> **
>
> I dont think i know what you mean? Do you mean move the packet sending
> somewhere else in the program because i think you need that in the while
> loop. Do you need the servicing on both client and server?
>
>
>
> On 2013-10-21 23:21, Nuno Silva wrote:
>
> One thing I noticed that might have something to do with it is how you
> block your client programs to get a message to send to the server, maybe
> you should do the ENet code in another thread to prevent ENet from doing
> its host servicing while waiting for a message.
>
>
> On Mon, Oct 21, 2013 at 11:05 PM, <stuart at semag.juplo.com> wrote:
>
>>  My Enet code dose not seem to be able to work correctly. I am new to
>> enet and i would prefer this over a high level networking lib. On my pc it
>> works how it should but when a client tries to connect to the server it
>> connects but if another one connects they both get disconnected there is
>> more information at
>> http://www.ogre3d.org/forums/viewtopic.php?f=1&t=79188 if you want to
>> look there. If any of you do have client and server code that you know
>> works outside of lan i would like to see it so i can compare it and try it.
>>
>> Thanks
>>
>>
>> _______________________________________________
>> ENet-discuss mailing list
>> ENet-discuss at cubik.org
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>>
>>
> _______________________________________________
> ENet-discuss mailing listENet-discuss at cubik.orghttp://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20131023/d4579474/attachment.html>


More information about the ENet-discuss mailing list