UDP socket - simple question

UDP socket - simple question

Post by MSF » Tue, 21 Jan 2003 05:42:13



Hi

I've just started programing, using C language and UDP Sockets (in Linux);
(so I have a few problems)

I have two programs (client and server);
    -Client send (interactive) request information about server network
configuration (/sbin/ifconfig)

        -Server
                if(!strcasecmp(dgram,"interface")){
          should do this request
                system("/sbin/ifconfig")
           and send it to client
                ??????? HOW ??????

Simple use
            variable1 = system("/sbin/ifconfig")
            sprintf("%s",variable1)
 doesn't work (problem with buffer, even I set it bigger),
  if I change sprintf into printf - information about network configuration
    will be appear on server screen - of course,

    but how send it to Client?
(maybe first write to file, and then to buffer - gradually, after this send
it to Client
 - if it's good idea - how write it?

Big thanks for any answer

with regards
Martin

 
 
 

1. UDP Socket - simple question

Hi

I've just started programing, using C language and UDP Sockets (in Linux);
(so I have a few problems)

I have two programs (client and server);
    -Client send (interactive) request information about server network
configuration (/sbin/ifconfig)

        -Server
                if(!strcasecmp(dgram,"interface")){
          should do this request
                system("/sbin/ifconfig")
           and send it to client
                ??????? HOW ??????

Simple use
            variable1 = system("/sbin/ifconfig")
            sprintf("%s",variable1)
 doesn't work (problem with buffer, even I set it bigger),
  if I change sprintf into printf - information about network configuration
    will be appear on server screen - of course,

    but how send it to Client?
(maybe first write to file, and then to buffer - gradually, after this send
it to Client
 - if it's good idea - how write it?

Big thanks for any answer

with regards
Martin

2. Getting the output of 'jobs' into a shell variable

3. How to receive UDP and ICMP packet using one UDP socket, (Path MTUD)

4. pixmap to tiff

5. aplication to receive [ethernet|IP|UDP] and [ethernet|ppp|IP|UDP] packages over socket

6. telnet, rlogin, rdate port problem

7. application to receive ethernet|IP|UDP a ethernet|ppp|IP|UDP packages over socket

8. Russian fonts with KDE - HOWTO?

9. NIS+ Simple Question : Does It Use TCP or UDP ?

10. UDP server: single socket or multiple socket?

11. TCP socket to UDP socket?

12. Questions on UDP datagram sockets

13. Question on write to UDP socket