UDP Request For Help
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > UDP Request For Help




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    UDP Request For Help  
alijsyed


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-09-06 12:24 PM

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)

Thanks

Ali






[ Post a follow-up to this message ]



    Re: UDP Request For Help  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: UDP Request For Help  
Renato


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-09-06 06:24 PM

alijsyed wrote:
> 1) I need a server to broadcast a general multicast packet to all
> listening CLients
> 2) CLients repsond back and both switch to TCP

googling for "udp server c" I just found:
http://pont.net/socket/

i'm sure you can find much more...

By switching to TCP, you don't need to switch it on the same session
(UDP has no "session"), but you can just trigger a TCP client to connect
to the TCP server on the same machine.


--renato





[ Post a follow-up to this message ]



    Re: UDP Request For Help  
Dave Littell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-11-06 06:27 PM

alijsyed wrote:
> 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)
>

Definitely buy a copy of UNIX Network programming (Stevens, et al).

Are all the clients on the same subnet as the server?  If you use a
subnet broadcast to a specific UDP port (to which the clients have
already bound) you can then have the clients bring up their TCP
connection(s) to the server.

Or, you might want to use only TCP and use a superserver architecture.


Good luck,
Dave





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:38 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register