jjescri
asked on
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.
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.
ASKER
The loop is this
Begin Loop
if the socket is not NULL, close it.
create a new socket
End loop
Begin Loop
if the socket is not NULL, close it.
create a new socket
End loop
your OS?
this is related to maximum file descriptors you can open at one time...
this is related to maximum file descriptors you can open at one time...
ASKER
My OS is Linux Red Hat 7.3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Thanks,
BD
if the socket is not NULL, close it.
create a new socket (socket is not null anymore).
loop