Re: need some help with tcp/ip programming

2007-05-18 Thread guy keren
hachar Shemesh Sent: Tuesday, May 15, 2007 8:14 AM To: Amos Shapira Cc: Linux-IL Subject: Re: need some help with tcp/ip programming Amos Shapira wrote: in neither case will read return 0. the only time that read is allowed to return 0, is when it encounters an EOF. for a socket, thi

Re: need some help with tcp/ip programming

2007-05-18 Thread guy keren
-- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of guy keren Sent: Tuesday, May 15, 2007 3:17 AM To: Amos Shapira Cc: Linux-IL Subject: Re: need some help with tcp/ip programming Amos Shapira wrote: On 15/05/07, *guy keren* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>

Re: need some help with tcp/ip programming

2007-05-16 Thread Nadav Har'El
On Wed, May 16, 2007, Rafi Cohen wrote about "RE: need some help with tcp/ip programming": > Hi Nadav, well, in my case I do not have thousands of concurrent > connections, about 20-30 only. In this case, the performance difference between an implementation using select, poll, ep

RE: need some help with tcp/ip programming

2007-05-15 Thread Rafi Cohen
[mailto:[EMAIL PROTECTED] On Behalf Of Nadav Har'El Sent: Tuesday, May 15, 2007 3:23 PM To: guy keren Cc: [EMAIL PROTECTED]; Amos Shapira; Linux-IL Subject: Re: need some help with tcp/ip programming On Mon, May 14, 2007, guy keren wrote about "Re: need some help with tcp/ip programming

RE: need some help with tcp/ip programming

2007-05-15 Thread Rafi Cohen
mething else? Thanks, Rafi. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shachar Shemesh Sent: Tuesday, May 15, 2007 8:14 AM To: Amos Shapira Cc: Linux-IL Subject: Re: need some help with tcp/ip programming Amos Shapira wrote: > > in neither cas

Re: need some help with tcp/ip programming

2007-05-15 Thread Shachar Shemesh
Rafi Cohen wrote: > 2. I indeed was one of the people that was not aware of epoll until you > mentioned it. > I began to read the man pages related to epoll, but for the time being > terminology like "edge triggered" or "level triggered" need deeper > understanding from my side. > Edge triggered

RE: need some help with tcp/ip programming

2007-05-15 Thread Rafi Cohen
Behalf Of guy keren Sent: Tuesday, May 15, 2007 3:17 AM To: Amos Shapira Cc: Linux-IL Subject: Re: need some help with tcp/ip programming Amos Shapira wrote: > On 15/05/07, *guy keren* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> > wrote: > > > I thi

Re: need some help with tcp/ip programming

2007-05-15 Thread Nadav Har'El
On Mon, May 14, 2007, guy keren wrote about "Re: need some help with tcp/ip programming": > >this is interesting. can anyone provide more info on this? > the problem with select, is that it is unable to optimize handling of > 'holes' in the file descriptor set. &

Re: need some help with tcp/ip programming

2007-05-15 Thread guy keren
Shachar Shemesh wrote: guy keren wrote: Amos Shapira wrote: On 14/05/07, *guy keren* <[EMAIL PROTECTED] > wrote: Alas - I think that I've just read not long ago that there is a bug in Linux' select in implementing just that and it might miss the close from the other s

Re: need some help with tcp/ip programming

2007-05-15 Thread Shachar Shemesh
Chava Leviatan wrote: > Are there any "rules" for setting how many connections will be handled > by one thread when > using the pool thread method ? It greatly depends on the amount of offline processing that needs to be done. If, like netchat, it is mostly a case of "receive, compare, send", then

Re: need some help with tcp/ip programming

2007-05-15 Thread Chava Leviatan
Yes, it is probably better to use a single thread that does the event waiting, and a thread pool for the actual processing. Having one thread pet socket, however, is not a wise idea IMHO. Are there any "rules" for setting how many connections will be handled by one thread when using the poo

Re: need some help with tcp/ip programming

2007-05-14 Thread Shachar Shemesh
Amos Shapira wrote: > > in neither case will read return 0. the only time that read is allowed > to return 0, is when it encounters an EOF. for a socket, this happens > ONLY if the other side closed the sending-side of the connection. > > > Is there an on-line reference (or a manual pag

Re: need some help with tcp/ip programming

2007-05-14 Thread Shachar Shemesh
guy keren wrote: > Amos Shapira wrote: >> On 14/05/07, *guy keren* <[EMAIL PROTECTED] >> > wrote: >> >> Rafi Cohen wrote: >> > Reading some documentation on tcp/ip programming, I had the >> impression >> > that the select mechanism should detect such remo

Re: need some help with tcp/ip programming

2007-05-14 Thread Amos Shapira
On 15/05/07, guy keren <[EMAIL PROTECTED]> wrote: Amos Shapira wrote: > On 15/05/07, *guy keren* <[EMAIL PROTECTED] > > wrote: > > > I think you are tinkering with semantics and so miss the real > issue (do > > you work as a consultant? :). > > did you

Re: need some help with tcp/ip programming

2007-05-14 Thread guy keren
Amos Shapira wrote: On 15/05/07, *guy keren* <[EMAIL PROTECTED] > wrote: > I think you are tinkering with semantics and so miss the real issue (do > you work as a consultant? :). did you write that to rafi or to me? i'm not dealing with semantics - i

Re: need some help with tcp/ip programming

2007-05-14 Thread Amos Shapira
On 15/05/07, guy keren <[EMAIL PROTECTED]> wrote: > I think you are tinkering with semantics and so miss the real issue (do > you work as a consultant? :). did you write that to rafi or to me? i'm not dealing with semantics - i am dealing with a real problem, that stable applications have to de

RE: need some help with tcp/ip programming

2007-05-14 Thread Rafi Cohen
r the most valuable information, Rafi. -Original Message- From: guy keren [mailto:[EMAIL PROTECTED] Sent: Monday, May 14, 2007 11:18 PM To: Rafi Cohen Cc: '[EMAIL PROTECTED] Org. Il' Subject: Re: need some help with tcp/ip programming (rafi - your quoting mixes your text with mine

Re: need some help with tcp/ip programming

2007-05-14 Thread guy keren
Amos Shapira wrote: On 14/05/07, *guy keren* <[EMAIL PROTECTED] > wrote: Rafi Cohen wrote: > Reading some documentation on tcp/ip programming, I had the impression > that the select mechanism should detect such remote disconnect event, > thus ena

Re: need some help with tcp/ip programming

2007-05-14 Thread guy keren
[EMAIL PROTECTED] wrote: > amos shapira wrote: Maybe using poll(2) will help you around that (I also heard that poll is generally more efficient because it helps the kernel avoid having to re-interpret the syscall parameters on every call). this is interesting. can anyone provide more info on

Re: need some help with tcp/ip programming

2007-05-14 Thread guy keren
(rafi - your quoting mixes your text with mine - you might want to fix this - it was very hard to read your letter). see my comments below: Rafi Cohen wrote: Hi Guy Rafi Cohen wrote: So, I have a couple of questions and I'll most apreciate any assistance. 1. Would you confirm that select

Re: need some help with tcp/ip programming

2007-05-14 Thread michael
this is a great thread - i'm learning a lot by reading it, even though i've been programming sockets for years. thanks for the question, and thanks for all the great answers. Another point to check - does the read(2) after select(2) return an error? See select_tut(2) for more details on how to

RE: need some help with tcp/ip programming

2007-05-14 Thread Rafi Cohen
to read from it and even get an error. But thanks anyway. Rafi. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Amos Shapira Sent: Monday, May 14, 2007 1:16 PM To: Linux-IL Subject: Re: need some help with tcp/ip programming On 14/05/07, guy keren <[EMAI

Re: need some help with tcp/ip programming

2007-05-14 Thread Amos Shapira
On 14/05/07, guy keren <[EMAIL PROTECTED]> wrote: Rafi Cohen wrote: > Reading some documentation on tcp/ip programming, I had the impression > that the select mechanism should detect such remote disconnect event, > thus enabling me to make a further "read" from this socket which should > end in

RE: need some help with tcp/ip programming

2007-05-14 Thread Rafi Cohen
Hi Guy Rafi Cohen wrote: > Hi, as a pproject for a company I'm writing a tcp/ip application on > linux using C language. ah welcome, welcome to the pleasure dome... Hmm, thanks for your "warm" greetings. > My application has 2 connections as client to remote servers and is by > itself a server "

Re: need some help with tcp/ip programming

2007-05-14 Thread guy keren
Rafi Cohen wrote: Hi, as a pproject for a company I'm writing a tcp/ip application on linux using C language. ah welcome, welcome to the pleasure dome... My application has 2 connections as client to remote servers and is by itself a server "accepting" remote client connections. I'm using sel

need some help with tcp/ip programming

2007-05-14 Thread Rafi Cohen
Hi, as a pproject for a company I'm writing a tcp/ip application on linux using C language. My application has 2 connections as client to remote servers and is by itself a server "accepting" remote client connections. I'm using select() mechanism to manage all those connections. Everyting works nic