Results 1 to 15 of 15

Thread: VB6 - Winsock, Auto find server using UDP Broadcast (LAN ONLY)

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    VB6 - Winsock, Auto find server using UDP Broadcast (LAN ONLY)

    I attached a Client and a Server program, a simple Chat program demonstrating how to connect to the server without knowing the server's IP.

    This is done by broadcasting a message from the client to the entire network, when server receives the message, server will broadcast another message giving it's IP and port number to use to connect to it. When client receives the server's message, it knows where to connect to using TCP connection.

    Here's Pseudo code on what's going on (the messages that are sent back and forth)

    Client broadcasts: "Where are you ?" (Could be anything, this is just an example)
    Server receives message
    Server broadcasts: "IP=192.128.0.1, Port=8888" (the IP and port # are just examples)
    Client receives server's message, and knows where to connect to
    Client connects to server using TCP
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width