Forum > Networking and Web Programming

LNet installation error due to fastcgi.pp

<< < (2/3) > >>

JohnvdWaeter:
Speaking of lNet...

FCon : TLTCP

FCon.Count gives number of connections, right?

At first connection, it says 2 (?)

Further, when stresstesting (7 clients connecting / disconnecting at high rate) there is this moment that FCon.count becomes negative...  then it keeps on working, showing numbers like -1, -2, -3 etc and suddenly stops responding: connection refused by remote host

What does this mean?

tia!
John

Almindor:
The count is right when it says "+1". It returns the number of sockets including the listening socket (docs say: This property specifies the total number of sockets in the connection.)

However the fact that it goes -1 or more is wrong. Can you send me a test case? Also, what OS/platform etc.

JohnvdWaeter:
ok, problem solved.

lNet 0.6.4 fixed the negative count problem.

The freezing was not in the server, but in the client (winxp). Fast opening / closing of tcp-connections stalled. XP needs more time to release its sockets once connections are closed.

Vista and Win7 had no problem.

One final question: what does "ReuseAddress" mean? Could not find it in the doc_lnet.xml.

Thanks for testing!
John

Almindor:
ReuseAddress is used to tell the server that the address/port you bind can be reused without waiting. this is useful when debugging for example and your server crashes, you would normaly have to wait for some time when the socket is in TIME_WAIT[2] state. With ReuseAddress if this happens you can simply start on same port again.

NOTE: that on some less sophisticated OSes (Windows older versions for example) it's a security risk (don't use in production)

JohnvdWaeter:
Hi AlMindor,

I want to make sure my server does not get bloated with connections that are idle / not used for too long time.

Every client has a timestamp for last exchanged data. If the timestamp is longer then say about 3 minutes, I'd like to kill the connection.

So I iterate all connections and close them if the connection on that particular local port has been idle for too long:


--- Code: --- fcon.iterreset;
 while fcon.iternext do
  if ThisSessionIsIdle (metacode)
   then fcon.iterator.disconnect(true);

--- End code ---

This works, the connection is closed (as I can see on the connected client, which says "connection lost"), but the count-property of fcon does not decrease.

Is this the proper way of getting rid of idle connections?

btw if I use disconnect(false), the count-property decreases, but an OnReceive event is triggered for the socket that just got disconnected.

tia!
John


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version