🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15187

Re: Utilisation TCPIP

#15187
From: Emmanuel Delahaye
Date: Tue, 04 Oct 2005 13:32
38 lines
2241 bytes
Akeu wrote on 04/10/05 :
> j'utilise une socket tcpip entre 2 syst�mes pour envoyer de donn�es ( de
> qq octets � plusieurs 10Moctets) c'est a peut pr�s comme ca:

Mmm. Les sockets ne font pas partie du langage C...

<HS>
> Lecfd= accept(listenfd, (struct sockaddr *) NULL, NULL))
> fcntl (Lecfd,F_SETFL,O_NONBLOCK); // pour ne pas �tre bloquant

Mauvaise id�e. Utiliser plut�t select()...

> // boucle
> // allocation m�moire de TableauAEnvoyer
> write ( Lecfd, TableauAEnvoyer, LongueurTableauAEnvoyer);
> // deallocation de la m�moire TableauAEnvoyer

J'esp�re que tu es blocant, sinon, c'est le crash !

> Pour l'instant j'ai une erreur d�s que je d�salloue la m�moire ( je
> pense que les datas ne sont pas encore parties ou lues par le 2ieme PC)

Ben oui, normal.

> J'aimerai savoir comment faire pour savoir quand je peux de nouveau
> reboucler et relancer des datas)

select(). (2�me famille de flux)

</>

-- 
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"There are 10 types of people in the world today;
those that understand binary, and those that dont."
Technical Details
Message-ID: <mn.23a47d5abd2502e4.15512@YOURBRAnoos.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!infeed-4.proxad.net!nnrp10-1.free.fr!not-for-mail
References: <pan.2005.10.04.11.58.14.121495@Akeu.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,cc457e6fd08331cd
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!proxad.net!infeed-4.proxad.net!nnrp10-1.free.fr!not-for-mail
Subject: Re: Utilisation TCPIP
From: "Emmanuel Delahaye" <emdel@YOURBRAnoos.fr>
References: <pan.2005.10.04.11.58.14.121495@Akeu.com>
Newsgroups: fr.comp.lang.c
Message-ID: <mn.23a47d5abd2502e4.15512@YOURBRAnoos.fr>
X-Newsreader: MesNews/1.04.00.00-fr
Date: Tue, 04 Oct 2005 15:32:00 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 40
Organization: Guest of ProXad - France
NNTP-Posting-Date: 04 Oct 2005 15:32:03 MEST
NNTP-Posting-Host: 81.65.109.202
X-Trace: 1128432723 nnrp10-1.free.fr 4340 81.65.109.202:25781
X-Complaints-To: abuse@proxad.net