Re: lug-bg: socket programming
- Subject: Re: lug-bg: socket programming
- From: firedust@xxxxxxx (Stanislav Lechev)
- Date: Mon, 28 May 2001 19:14:49 +0300
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 28 May 2001 14:51, you wrote:
> Zdravei,
>
> Kato prochetah po-vnimatelno kakvo pisa, problemyt e pri izprastastata
> strana. Taka che zabravi za sockopt(). Viw syobstenieto na G. Georgiev.
interesno... sys sockopt se oprawi :)
kakto kazah weche problema ne e pri izprashtashtata strana
problema beshe server side
pomisli logichno
kato napishesh telnet cisco.host.net
telnet-a ti kak znae che ne trqbwa da buferira
??????
problema e serverside
>
> On Mon, 28 May 2001, Stanislav Lechev wrote:
> >sys setvbuf moga da premahna biffer-a na FD (read/write) ot files
> >no kogato stawa duma za socket neshte i neshte
>
> socket() vrysta file descriptor, a ne bufer, taka che tova, koeto si
> pravil e niamalo smisyl (osven ako ne si prevyrnal sock filedes v bufer
> predi tova).
znachi ...
int setvbuf(FILE *stream, char *buf, int mode , size_t size);
eto sintaksisa na setvbuf
taka kato az imam az imam file descriptor a ne filestream
ne moga da izpolzwam towa...
no kato se ima predwid che sym kopiral whoda i 2ta izhoda
t.e.:
dup2(insock, 0);
close(insock);
dup2(0, 1);
dup2(0, 2);
setvbuf(stdin, (char *) NULL, _IONBF, 0);
setvbuf(stdout, (char *) NULL, _IONBF, 0);
setvbuf(stderr, (char *) NULL, _IONBF, 0);
moga da polzwam bez probs setvbuf...
problema e che nqma efekt kakto i se ochakwashe ...
zashtoto az prosto zaobikolih problema e ne go reshih
za towa popitah za zamestitel na setvbuf no za socket
>
> >da i az izpolzwam libreadline no problema e che kogato cheta ot socket
> >dori i da iskam da procheta samo 1 byte
> >toj ne idwa do mene dokato ne e natisnat enter-a
> >t.e.
> >az cheta 1 byte... otsreshta mogat da mi napishat 101 no te shte stignat
> >do mene edwa sled natiskaneto na enter
> >ta towa e linebuffer
>
> Da tova e line buffering, no pri sender, a ne receiver! Problemyt e na
> otsrestnata strana.
>
> Vladimir Dzhuvinov
>
> --
> PGP 1024D/959FC3BC 2001-02-12 Vladimir Dzhuvinov <vd@xxxxxxxxx>
> Key fingerprint = CB20 FC83 775C C34E 49D5 0F71 BAE5 7C38 959F C3BC
> Download public PGP key from http://www.valan.net/vdzhuvinov.asc
>
> ===========================================================================
> A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
> http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
- --
- -===============================================================-
- - Regards, AngelFire -
- - Stanislav Lechev <firedust@xxxxxxx> -
- - PGP Key: http://firedust.vega.bg/pgp/StanislavLechev.asc -
- - Vega Internet Service Provider (tm) -- http://www.vega.bg -
- -===============================================================-
Everyone is a genius.
It's just that some people are too stupid to realize it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7Enl78RPXBhiMqewRAsfJAJ4q4u6d3JaNqsER5wzHTy2DlNk+QQCbBTo9
h5sBYaGAKEhjFDmPLHi5DO8=
=M7LC
-----END PGP SIGNATURE-----
===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|