 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

8th May 2010, 12:10 PM
|
 |
"Fixed" by (vague) request
|
|
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950

|
|
|
Re: java.net.SocketException: Too many open files
I have updated the code attached to post #21 with:
.JPollard's correction
.New log4j XML configuration file, with DailyRollingFileAppender
. SoTimeout of 10s on reads: If more than 10 seconds elapse between two reads, an exception is thrown and the files are closed. Of course it needs to be tuned to a real production scenario...
hth
Last edited by giulix; 8th May 2010 at 12:13 PM.
|

8th May 2010, 12:25 PM
|
|
Registered User
|
|
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,094

|
|
|
Re: java.net.SocketException: Too many open files
Now the next question is why does the client not close the connection when it
is finished?
Aborting connections after a timeout is completely reasonable - but knowing
the connection should be terminated would seem to be the responsibility of
the client.
|

8th May 2010, 04:55 PM
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 104

|
|
|
Re: java.net.SocketException: Too many open files
Dear Giulix,
Thank you for the codes. I have a new scenario now after implementing the timeout my established connections become very small. Ok for now I just testing it with 3 minutes timeout. Then I have done some analysis on the networking below is some sample.
Sample 1
Close Wait (3), Fin Wait1(4), Syn Recv(4),Time Wait(9), Establised(28)
Sample 2
Close Wait (3), Fin Wait1(4), Syn Recv(4),Time Wait(4), Establised(29)
Sample 3
Close Wait (4), Fin Wait1(4), Establised(37)
So I notice I can not achieve even 50 established connection at any one time. What shall I do beside increasing the timeout ? Do you have any idea where I was thinking once I receive my data string the last character is an "#". So is there any way where once I have read the "#" done with the insert into the db and text file then close the connection?
|

8th May 2010, 06:13 PM
|
 |
"Fixed" by (vague) request
|
|
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950

|
|
|
Re: java.net.SocketException: Too many open files
It is not clear to me what that data represents. Maybe you can explain what you mean by "small connections". Is such a long timeout really necessary? I mean, are your clients transmitting such a large amount of data or is just the nature of the network connection you are dealing with that takes so long? It seems a huge amount of time to me, way too long to transmit simple location data, but maybe that is not all.
When you say you cannot achieve 50 connections at a time, what do you mean? In which amount of time? Are you saying that with 50 connections you reach the open files limit? Sorry, but I haven't understood what are the kind of problems you're encountering now...
And to answer your question about the # character, yes, it is entirely up to you to do what you deem appropriate when you receive a particular piece of information.The clients have a special way to communicate that they're done transmitting their data, and that is by sending the EOF character, but if you can't teach them to do that, just observe their behaviour, see what event is produced when they're finished, and react accordingly.
|

9th May 2010, 06:17 AM
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 104

|
|
|
Re: java.net.SocketException: Too many open files
Dear Giulix & Jpollard,
Let me share the details this how it works I have put the sample below. First the client first time it will send the PRFV message then it will get a reply of $PA. So once the $PA is recieve means the connection is build and there after it will keep sending the GPS that is the PRPA and keeping getting reply of $PA. So this is the full details. The last character is always #. As you can see in my code that is why I look for if (m==35). That means I have found a # and do the processing. I was thinking immediately after processing should I terminate what is your suggestion?
$PRFV,ES02,5,09.6,090510,265265,13526*38# (From client to build the connection/handshake)
$PA (ACK from server)
$PRPA,000536,090510,3.72490,101.46882,12,53.0,297. 0,1.0,1,01400028F020,563853,13525.21,13526*61# (GPS data from client)
$PA (ACK from server)
---------- Post added at 09:09 PM CDT ---------- Previous post was at 07:49 PM CDT ----------
Dear Giulix,
In fedora is there any thing like Wireshark to monitor the network details. Because I went here https://admin.fedoraproject.org/pkgd...wireshark#F-10 it say not implemented yet. Any idea how can I do maybe other tools? Thank you.
---------- Post added at 09:17 PM CDT ---------- Previous post was at 09:09 PM CDT ----------
Dear Giulix,
OK I have managed to install it using the yum. But is it possible for me to use from remote meaning from telnet is it? Thank you.
|

9th May 2010, 09:44 PM
|
 |
"Fixed" by (vague) request
|
|
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950

|
|
|
Re: java.net.SocketException: Too many open files
With that kind of conversation, it would seem sensible to close the connection after sending the ACK to the $PRPA message.
As for wireshark, I'm not an expert but it being a graphical tool, it's not possible to use telnet except if you you use it to forward the X11 connection. In that case, you're probably better off using `ssh -X'. Otherwise, you're gonna need a remote desktop application like VNC (yum install vnc) or similar. I am not experienced about that, I suggest you open another thread for assistance; else, you can use a non-graphical application to sniff traffic, like tcpdump.
|

10th May 2010, 04:15 AM
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 104

|
|
|
Re: java.net.SocketException: Too many open files
Dear Giulix,
I was thinking after receiving the # from the $PRPA and processign done then stop it what do you think? What is X11 connection? Nvm I will do about the the wireshark.Thank you.
Quote:
Originally Posted by giulix
With that kind of conversation, it would seem sensible to close the connection after sending the ACK to the $PRPA message.
As for wireshark, I'm not an expert but it being a graphical tool, it's not possible to use telnet except if you you use it to forward the X11 connection. In that case, you're probably better off using `ssh -X'. Otherwise, you're gonna need a remote desktop application like VNC (yum install vnc) or similar. I am not experienced about that, I suggest you open another thread for assistance; else, you can use a non-graphical application to sniff traffic, like tcpdump.
|
|

10th May 2010, 08:22 AM
|
 |
"Fixed" by (vague) request
|
|
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950

|
|
|
Re: java.net.SocketException: Too many open files
Quote:
Originally Posted by newbie14
I was thinking after receiving the # from the $PRPA and processign done then stop it what do you think?
|
I think it's ok
Quote:
Originally Posted by newbie14
What is X11 connection? Nvm I will do about the the wireshark
|
If you are accessing a Linux/Unix machine from another, you can run the graphical application remotely with X11 (tldp.org). X11 is the underlying system supporting graphical applications on Linux/Unix
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 17:53 (Sunday, 19-05-2013)
|
|
 |
 |
 |
 |
|
|