| | |
Help with programming a chat program. (Urgent)
![]() |
Hi
You probably know all this already and forgive me if so but normally a central server manages the clients and connections; it's IP could be distributed with the clients and they then connect to the server rather than each other.
In a pure peer-to-peer network, which is what your serverless chat is, the clients (or, more correctly, peers) don't know who to connect to. So how do they discover each other? The obvious way is for peers to broadcast UDP packets (sent to 255.255.255.255), and listen for these from other peers. A list of IP's discovered can be maintained, and the user can then initiate direct TCP connections (on a different port) to one or more of these.
Here are some snags:
* UDP is a 'fire and forget' protocol- you don't how far your packet got.
* UDP broadcasts are normally blocked by firewalls, unless you explicitly open up the port for UDP (not recommended for security).
The good news is, the basic mechanism of text chat using the Winsock control is fairly easy.
Could be an interesting challenge!
Regards,
AlanC
You probably know all this already and forgive me if so but normally a central server manages the clients and connections; it's IP could be distributed with the clients and they then connect to the server rather than each other.
In a pure peer-to-peer network, which is what your serverless chat is, the clients (or, more correctly, peers) don't know who to connect to. So how do they discover each other? The obvious way is for peers to broadcast UDP packets (sent to 255.255.255.255), and listen for these from other peers. A list of IP's discovered can be maintained, and the user can then initiate direct TCP connections (on a different port) to one or more of these.
Here are some snags:
* UDP is a 'fire and forget' protocol- you don't how far your packet got.
* UDP broadcasts are normally blocked by firewalls, unless you explicitly open up the port for UDP (not recommended for security).
The good news is, the basic mechanism of text chat using the Winsock control is fairly easy.
Could be an interesting challenge!
Regards,
AlanC
![]() |
Similar Threads
- chat program (Java)
- chat program concept using c++ (C++)
- Chat program (Java)
- Error in c++ program (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Code advice For list selection
- Next Thread: help beginner recieive data through pstn line using ademco contact id protocol
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





