From: Ron Michael Khu <ronkhu@ntsp.nec.co.jp>
To: linux-c-programming@vger.kernel.org
Subject: Re: Socket and STDIN pooling
Date: Wed, 15 Feb 2006 13:28:37 +0800 [thread overview]
Message-ID: <43F2BC05.5030700@hq.ntsp.nec.co.jp> (raw)
In-Reply-To: <6a00c8d50602132236l2c7e5337v471ca48c8b8a4f79@mail.gmail.com>
select() with the 3 file descriptors :D
provided that the processing time for input (from stdin and the sockets)
is negligible.
if processing time is an issue...
you could try doing a fork() for the individual processing
Steve Graegert wrote:
>On 2/14/06, Lejanson C. Go <lejanson@ntsp.nec.co.jp> wrote:
>
>
>>Hi,
>>
>>I have a question about pooling 2 sockets and stdin.
>>
>>
>
>I suppose you mean "polling".
>
>
>
>>I am currently making an application which accepts
>>input from the stdin.
>>
>>It had a connection to a server connecting to 2ports.
>>If for example the stdin is a blocking descriptor and
>>the 2 other descriptors are to be checked real time
>>how can it be done without using threads?
>>
>>
>
>See (p)select(2) and poll(2) system calls. Numerous examples on how
>to utilize both functions can be found in the Net.
>
> \Steve
>
>--
>
>Steve Graegert <graegerts@gmail.com>
>Software Consultant {C/C++ && Java && .NET}
>Office: +49 9131 7123988
>Mobile: +49 1520 9289212
>-
>To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
>
next prev parent reply other threads:[~2006-02-15 5:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 5:26 Socket and STDIN pooling Lejanson C. Go
2006-02-14 6:36 ` Steve Graegert
2006-02-15 5:28 ` Ron Michael Khu [this message]
2006-02-15 5:46 ` Ron Michael Khu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43F2BC05.5030700@hq.ntsp.nec.co.jp \
--to=ronkhu@ntsp.nec.co.jp \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).