🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #7911

UDP socket - simple question

#7911
From: MSF
Date: Sun, 19 Jan 2003 20:54
33 lines
2068 bytes
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
Technical Details
Message-ID: <b0f39s$1g8p$1@foka.acn.pl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!news.wind.surfnet.nl!surfnet.nl!teleglobe.net!newsfeed.tpinternet.pl!news.icm.edu.pl!news.astercity.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f86c8,3672983a83160639,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-01-19 12:54:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!news.wind.surfnet.nl!surfnet.nl!teleglobe.net!newsfeed.tpinternet.pl!news.icm.edu.pl!news.astercity.net!not-for-mail
From: "MSF" <msf@z.pl.delete>
Newsgroups: es.comp.os.linux.programacion
Subject: UDP socket - simple question
Date: Sun, 19 Jan 2003 21:54:25 +0100
Organization: Aster City Net
Lines: 35
Message-ID: <b0f39s$1g8p$1@foka.acn.pl>
NNTP-Posting-Host: 14-bem-2.acn.waw.pl
X-Trace: foka.acn.pl 1043009660 49433 62.121.81.14 (19 Jan 2003 20:54:20 GMT)
X-Complaints-To: abuse@astercity.net
NNTP-Posting-Date: Sun, 19 Jan 2003 20:54:20 +0000 (UTC)
X-Tech-Contact: usenet@astercity.net
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-Server-Info: http://www.astercity.net/news/
X-MSMail-Priority: Normal