Results 1 to 2 of 2

Thread: SDL_net Questions

  1. #1
    Join Date
    Jul 2011
    Beans
    2

    Exclamation SDL_net Questions

    I think you guys may have missed my post......well basically I was wondering if you guys knew what these functions were, what they did, & when is it applicable for them to be used? I'm using a UDP approach working from SDL_net. Also, how does the server know where packets come from so it can send something back?
    • SDLNet_ResolveHost( IPaddress * address, char * host, Uint16 port )
      • What does it mean when "host" is NULL?

    • SDLNet_UDP_Bind( UDPsocket sock, int channel, IPaddress * address )
      • What are you binding and What is the purpose to binding?

    • SDLNet_UDP_GetPeerAddress( UDPsocket sock, int channel )
      • When would you use this?


    PS: For a more detailed list of questions please visit my prior post.
    http://ubuntuforums.org/showthread.php?t=1795073

    Thanks,
    ~Cpt_USMC
    Last edited by Cpt_USMC; July 2nd, 2011 at 10:50 PM.

  2. #2
    Join Date
    Apr 2011
    Beans
    25

    Re: SDL_net Questions

    Quote Originally Posted by Cpt_USMC View Post
    [LIST][*]SDLNet_ResolveHost( IPaddress * address, char * host, Uint16 port )
    • What does it mean when "host" is NULL?
    You use NULL to tell it you are listening (a server listens).
    Quote Originally Posted by Cpt_USMC View Post
    [*]SDLNet_UDP_Bind( UDPsocket sock, int channel, IPaddress * address )
    • What are you binding and What is the purpose to binding?
    Binding is for sockets, it asks the OS "Oh, can I reserve port x?". In order to listen to a port you must bind it to your program.
    Quote Originally Posted by Cpt_USMC View Post
    [*]SDLNet_UDP_GetPeerAddress( UDPsocket sock, int channel )
    • When would you use this?
    To get the IP of the computer who sent you the packet.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •