[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 436
  • Last Modified:

destroying socket

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
jjescri
Asked:
jjescri
  • 2
  • 2
  • 2
1 Solution
 
BlackDiamondCommented:
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
 
jjescriAuthor Commented:
The loop is this

Begin Loop
  if the socket is not NULL, close it.
  create a new socket
End loop
0
 
cincin77Commented:
your OS?
this is related to maximum file descriptors you can open at one time...
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
jjescriAuthor Commented:
My OS is Linux Red Hat 7.3
0
 
cincin77Commented:
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
 
BlackDiamondCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now