06-09-06 12:24 PM
"alijsyed" <alijsyed@hotmail.com> writes:
> Hi:
>
> I would like to ask all of you if there is any reference code relating
> to the following:
>
> 1) I need a server to broadcast a general multicast packet to all
> listening CLients
> 2) CLients repsond back and both switch to TCP
>
> This sounds trivial but trust me I can't find much on this.
> I find a lot of stuff on UDP clients initializing the conversation but
> not the server.
>
> Any help would be appreciated. (I am trying to do this in C not C++).
> (I am using Linux as well)
There's no difference.
There's no notion of client or server in UDP or TCP.
Just peer hosts sending and receiving UDP packets, or listenning for
incoming TCP connections and connecting to TCP ports.
So what you have is:
1) a host that broadcasts a general multicast packet to other hosts
listening for it,
2) a host that responds to a UDP packet.
3) a host that connect to a remote TCP port.
4) a host that listen to a TCP port.
I guess in all the examples you have at hand, you'll be able to find
how to do each of these operations.
--
__Pascal Bourguignon__ http://www.informatimago.com/
Until real software engineering is developed, the next best practice
is to develop with a dynamic system that has extreme late binding in
all aspects. The first system to really do this in an important way
is Lisp. -- Alan Kay
[ Post a follow-up to this message ]
|