About Store Forum Documentation Contact



Post Reply 
UDP receives nothing
Author Message
Tupac Offline
Member

Post: #1
UDP receives nothing
Hi. I use a standard Winsock server for my game and i have a problem to comunicate whith Esenthel sockets in UDP mode.
1rst, i dont undersand differance between CreateUdp() and CreatePeer(port). Maybe a peer is an UDP with Addr inside ??
I tryed both and my server send perfectly packets to my bot application (bot in dos console + winsock) and my receiver Thread in my game doesn't receive anything !!!

Init:
Code:
s_recoi.createUdp(); // or createPeer(port); same problem !
   _srv_addr.ip(ip);
   _srv_addr.port(port);

Thread:
Code:
    s_recoi.receive(_srv_addr, buff, sizeof(buff));
    console->add(buff); //console is my class to draw text in a custom console

Srv:

Code:
//s ia a DATAGRAM sock binded
ctrl = sendto(s, buff, sizeof(buff), 0, (SOCKADDR*)&srvAddr, sizeof(srvAddr));//sendto

Maybe an idea ? thanks in advance.
06-10-2009 12:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
Re: UDP receives nothing
createUdp creates a standard UDP socket,
and
createPeer creates UDP socket and then binds it to receive data from any IP using specific PORT

please take a look at network socket tutorial, maybe this will help
06-10-2009 01:03 PM
Find all posts by this user Quote this message in a reply
Tupac Offline
Member

Post: #3
Re: UDP receives nothing
Thx for explanation. I created a Peer on my client and unbind my server.
It works perfecly but i have two questions about network only:
- Can i launch two clients on the same computer ? I dont think i can bind two socks on the same port :/
- Will the users have to nat their UDP ports if behind a firewall to play the game ? UDP server in the client app :/

sorry! it's a noob question !
06-12-2009 12:23 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
Re: UDP receives nothing
Hi,

Full networking support isn't implemented yet so I can't help you with that.
As stated here in the FAQ <!-- m --><a class="postlink" href="http://www.esenthel.com/en/engine/about.html">http://www.esenthel.com/en/engine/about.html</a><!-- m -->
you need to implement the networking manually.

As I'm currently focusing on other things (improving World Editor).
06-12-2009 12:56 PM
Find all posts by this user Quote this message in a reply
Tupac Offline
Member

Post: #5
Re: UDP receives nothing
I undersand that's not the job of an engine.
I will post in c++ forums.
thx
06-12-2009 01:01 PM
Find all posts by this user Quote this message in a reply
Post Reply