Re: UDP or TCP?



Could someone give me direction on where to go if i would like to make
a network chat program for multiple users to use. Ive thought about tcp
but then again i know udp is more like a mass message to all connected
clients. so i was thinking that would be best. so if someone could
explain to me how to get started with that or even if you have input on
it. please if you could help that would be great. thankyou.

The thing with TCP is that it's strictly a two-party "connection-oriented"
protocol.
There are exactly two participants in a connection, usually known as
"client" and
"server". If you want multiple-person "chat", you have to create a server
program that
each client program connects with separately. The function of the server is
to relay each
incoming message, from any client, to all the other clients. This is how
most chat programs
work that use the internet. The devil's in the details, of course. That's
why people
take a little time to invent protocols.

You can use UDP "broadcast" mode to dispense with the central server
program, but you're limited to
conversations taking place over a single LAN connection, not the Internet at
large.

UDP broadcast is created by using the IP address of 255.255.255.255 as the
destination address
of each message sent. You pick a port number and then your chat program can
send everything
to that port number, using the broadcast IP address. Any program "listening"
on that port will get
the message. You have to pick a port number that won't conflict with any of
the standard ones used
for "serious" protocols. There is no privacy with this approach, because
anyone can run a program
that listens to any port, and you can't even tell they're doing it, but it's
simple and fun for your home
network.

Use the Winsock control to accomplish either of these.


.



Relevant Pages

  • Re: Unable to Connect Multiple VPN Clients via Linksys Router
    ... office's VPN using Cisco VPN Client 4.0.5client software over the ... behavior that when doing NAT on low UDP ports such as UDP port 500, ... they will not NAT the source port. ...
    (comp.dcom.sys.cisco)
  • Re: How to send the data from 1 process more process using sockets!
    ... When you say "port" are you talking about the port that ... The source port of UDP datagrams on the server ... Have the clients connect to all servers. ... Have the servers connect to each other and pass client information ...
    (comp.os.linux.development.apps)
  • RE: DNS Records
    ... tcp>1023 53 Client queries with long replies ... On other client types, ... if you lock down all but port ... a client queries an initial server from an unreserved port number to UDP ...
    (Security-Basics)
  • Re: sockets: connecting several UDP clients
    ... I'm quite uncertain if the using of the ports for UDP is correct in my mind. ... the acceptcall will return a new socket descriptor. ... Even if all you are interested in is the IP address of the client, you must take the sd and close it: ... // client on port 6666. ...
    (comp.os.linux.development.apps)
  • Re: thin client com ports
    ... I'm glad that you got at least one more client working! ... MCSE, CCEA, Microsoft MVP - Terminal Server ... the COM port settings? ... I am testing several thin clients. ...
    (microsoft.public.windows.terminal_services)