Results 1 to 4 of 4

Thread: Not for the faint Hearted!!

  1. #1

    Thread Starter
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425

    Question

    I'm making a Chat Program using UDP. The UDP port the messages are broadcast on is 51345. The problem is, on the LAN I tested the program on (Stations 1-4):

    1) Station 1 sent messages which only Station 2 picked up.

    2) Station 2 could not reply to Station 1's messages.

    3) Stations 3&4 couldn't do anything!!

    Is this because of UDP port configuration on the 4 Stations being different, or what?

    It is a sample app supplied with a Power TCP control, which I have customised slightly, but the part which sends messages etc has not been touched.

    Help Please!!

  2. #2
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    I'm not quite sure why that would be happening. Are each of your stations set up to recognize the others addresses? This is the only thing I can think of that would keep someone from sending info to another ... I've mainly been working with TCP and not UDP so I could be mistaken in how that function works.

    You also need to make sure that you are setting up a control array so that you can listen on one port and send on another.

    Hope this gets you going in the right direction.
    -Excalibur

  3. #3

    Thread Starter
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    The computers are on a fully working LAN. I don't understand UDP very well myself, so any help would be muchmuchmuch appreciated!

    THX Excaliburzone, I'll look into it.

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Location
    O!
    Posts
    1,177
    Have you checked out Using the Winsock Control? You may get some pointers there.

    I have never tried writing a chat program or used UDP for that matter, so I'm just taking a stab at this.

    Since you have to send the message to each computer using both the hostname (or IP address) and the port, it would seem that you would have to loop thru a list of computers that are "logged in". Each computer that "logs in" would have to send a login message and the computers receiving it would have to reply, identifying themselves.

    You could get the list of computers on the LAN from your hosts file and go thru it sending a login to each address to see who is listening. Each computer that is logged in would save the connecting computer's name in a table and reply with its own name which the new computer would also store in a table.

    As for port numbers, I don't know why each computer can't bind to the same number, so that LocalPort and RemotePort are the same.

    Then, as you send messages, you would loop thru the table of logged in computer names, change RemostHost to the table entry and send the text.

    Did that make sense?

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