?
Solved

destroying socket

Posted on 2002-05-22
6
Medium Priority
?
433 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

 

Author Comment

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

Accepted Solution

by:
cincin77 earned 300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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