Solved

destroying socket

Posted on 2002-05-22
6
423 Views
Last Modified: 2010-03-18
Hi,

I have a loop that close a socket if it is not equal to NULL and create the socket again. I can execute this loop 255 times. Why? How can I destroy the socket in order to avoid this problem?

Thanks in advance.
0
Comment
Question by:jjescri
  • 2
  • 2
  • 2
6 Comments
 
LVL 5

Expert Comment

by:BlackDiamond
ID: 7029987
Can you post the code for this?  From your description, the order of the loop sounds like:

if the socket is not NULL, close it.
create a new socket (socket is not null anymore).
loop

0
 

Author Comment

by:jjescri
ID: 7031645
The loop is this

Begin Loop
  if the socket is not NULL, close it.
  create a new socket
End loop
0
 
LVL 3

Expert Comment

by:cincin77
ID: 7032313
your OS?
this is related to maximum file descriptors you can open at one time...
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:jjescri
ID: 7032483
My OS is Linux Red Hat 7.3
0
 
LVL 3

Accepted Solution

by:
cincin77 earned 100 total points
ID: 7032662
write; sysctl -A
and check fs.super-max
it should be 256 for your machine
increase it by issuing following command:
echo XXXX > /proc/sys/fs/super-max
where XXXX is the max number you want

regards...

0
 
LVL 5

Expert Comment

by:BlackDiamond
ID: 7032939
Can you elaborate on what it is you want your logic to do, and post some real code. It doesn't make much sense to continuously open and close your sockets (which is what you have said you are doing) without some other code in there to do something with them while they are open.  It would really help us to help you if you can tell us what the application needs to do, and show us what your current socket code looks like.  I don't think you will get any helpful comments otherwise (we can only guess what you are trying to do).

Thanks,
BD
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now