Winsock list local servers
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Winsock list local servers

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Posts
    7

    Talking Winsock list local servers

    Hello Codeguru members!
    (first post, woohoo)

    I have been programming a multiplayer game for a friend, using asynchronous (non-blocking) sockets. Usually to connect, I just have people enter the IP of the server into the console and have it connect from that method. But people can forget IP's or mis-type them, so I was wondering if I could take a different approach.



    In Quake 2, a person can be the designated host for a game. Other clients can simply view a list of available local servers, click on they want, and they will be connected.


    If anyone at least could begin to explain how I might go about doing this, I would be more than willing to listen.

    Thanks!
    -Kaleb

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,642

    Re: Winsock list local servers

    If you are on a private LAN you could have the server broadcast at regular intervals and the clients to listen on that broadcast.

    http://forums.codeguru.com/archive/i.../t-340877.html
    http://stackoverflow.com/questions/3...-using-winsock
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

  3. #3
    Join Date
    Jun 2012
    Posts
    7

    Re: Winsock list local servers

    Thanks, S_M_A! That was exactly what I needed.
    Appreciate the help.
    -Kaleb

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center