Re: lug-bg: socket programming
- Subject: Re: lug-bg: socket programming
- From: firedust@xxxxxxx (Stanislav Lechev)
- Date: Mon, 28 May 2001 19:22:12 +0300
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 28 May 2001 15:29, you wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, 28 May 2001, Stanislav Lechev wrote:
> >znachi redowete si gi prashtam az :)
> >i znam koga si prashtam red i koga bukwa...
>
> Kakva funkcia polzvash za chetene na chars ot terminala?
probwah s
read
sled towa copirah file descriptorite
dup2(insock, 0);
close(insock);
dup2(0, 1);
dup2(0, 2);
sled towa moga da polzwam
getc
no nqma efekt
posle minah naprawo kym readline
kydeto probwah s rl_getc
wse taq
problema ostawa w buffera
>
> >no ne e w towa problema
> >problema e che ima line buffer
>
> line buffera e na tvoia terminal, a ne na sock
greshka...
linebufera e na file descriptora
az wse oshte nqmam izgraden terminal w socket-a si
probwaj da polzwash termios bez da si izgradil terminal ...
>
> >eto taka mahame bufera na kakwoto si iskame
> >no ne i na tcp socket :)
>
> sock e fd po default, niama buffer ;-)
za syvalenie trqbwa da te razocharowam:
man setvbuf
- ----------
Normally all files are block buffered.
If a stream refers to a terminal (as stdout normally does)
it is line buffered. The standard error stream
stderr is always unbuffered by default.
- ----------
towa potwyrvdawa che nqmam terminal i ostawam buferiran
- ----------
The setvbuf function may be used on any open stream to change its buffer.
- -----------
a towa che az se opitah da naprawq ot file descriptora
file stream :)
no to si pokaza :)
>
> Vladimir Dzhuvinov
[.....]
- --
- -===============================================================-
- - 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
iD8DBQE7Ens08RPXBhiMqewRAtX1AJ99lpb7tIyFbSqXM9QWQt8SAypxgQCfWIOd
Y7xXzdiHr9DCh8dUW7CJ6x0=
=ir2p
-----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
|