Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

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

Reply
 
Thread Tools Search this Thread Display Modes
  #46  
Old 8th May 2010, 12:10 PM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
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.
Reply With Quote
  #47  
Old 8th May 2010, 12:25 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,790
linuxfedorafirefox
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.
Reply With Quote
  #48  
Old 8th May 2010, 04:55 PM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 109
windows_xp_2003ie
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?
Reply With Quote
  #49  
Old 8th May 2010, 06:13 PM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
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.
Reply With Quote
  #50  
Old 9th May 2010, 06:17 AM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 109
windows_xp_2003ie
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.
Reply With Quote
  #51  
Old 9th May 2010, 09:44 PM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
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.
Reply With Quote
  #52  
Old 10th May 2010, 04:15 AM
newbie14 Offline
Registered User
 
Join Date: Feb 2010
Posts: 109
windows_xp_2003ie
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 View Post
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.
Reply With Quote
  #53  
Old 10th May 2010, 08:22 AM
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
linuxfedorafirefox
Re: java.net.SocketException: Too many open files

Quote:
Originally Posted by newbie14 View Post
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 View Post
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
Reply With Quote
Reply

Tags
files, javanetsocketexception, open

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I un-install the open source Java in Fedora 9 kumudini Using Fedora 3 9th September 2008 04:59 AM
F7, Open Office, Java and Nautilus nicstevens42 Using Fedora 5 12th August 2007 06:04 PM
files want to open with java.... StevenMedley Using Fedora 1 4th July 2007 02:05 AM
How will an Open Source Java effect linux? KClaisse Linux Chat 9 28th October 2006 05:51 AM
good news- open source of JAVA and ATI drivers steve941 Using Fedora 2 16th August 2006 12:59 PM


Current GMT-time: 08:35 (Saturday, 02-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat