08-03-2009
socket system call can not succedd right after application crash.
hello all,
I have developed a server application in C for ulinux kernel 2.6.It works very fine; creating a socket, binding it to a port, listening for incoming sockets and accepting them ,all finish without any error.
But there is a problem regarding application crash.After an intentionally termination of the application(Ctrl+C) or the application crash( by whatever reason it might be ) , when i run the application for the next time -right after application ending-, the socket creation stage fails for about 10" or more.After a while, the socket creation will succeed and everything starts normally.My question is why the socket creation cannot proceed?Is it because of still opened sockets from clients? it is because of underlying OS mechanism?
9 More Discussions You Might Find Interesting
1. Linux
Hi Everyone!
How can we make a socket() system call from a linux module executing in kernel space?
If any one knows, kindly tell me. It will be great.
I want to use the socket interface in linux kernel space for sending raw packets over the network.
Hamayun (0 Replies)
Discussion started by: mian_m_hamayun
0 Replies
2. UNIX for Dummies Questions & Answers
If I do a netstat -a I can see all the sockets currently open, is there a way that I can tell which application is holding open these sockets ? (3 Replies)
Discussion started by: murphyboy
3 Replies
3. Linux
helo,
i m using linux operationg system at both client and server side.
Now in my application when i use ntohl() then it will give segmentation fault.
now when i remove nothl(), then it works fine.
can u tell me why this happen.
amit (8 Replies)
Discussion started by: amitpansuria
8 Replies
4. Programming
Hi,
I am having an issue with using sockets.
I have a program which binds to a socket and listen on it. Later I spawn a thread to handle some function. In the new thread created I need to call a shell script which executes the specified function. Here I am using a system command to call the... (5 Replies)
Discussion started by: Janardhanbr
5 Replies
5. Programming
Hi All,
My application gets hang at the popen statement in Soalris 5.8. While debugging I found that it halts at _lwp_sema_wait. After googling I have added /usr/lib/lwp in the LD_LIBRARY_PATH and now it halts at lwp_park. Please help me what I need to do to solve this issue. The application runs... (6 Replies)
Discussion started by: Amiya Rath
6 Replies
6. Programming
Problem
- Linux Client/Server Socket Application: Preventing Client from quitting on server crash
Hi,
I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64.
I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies
7. IP Networking
Hello ;
This what i want to do :
I know that in the system call
#include <sys/socket.h>
int bind(int socket, const struct sockaddr *address,
socklen_t address_len);
you can specify the local port for your socket, but im using a private library , and im sure that in that library... (0 Replies)
Discussion started by: trutoman
0 Replies
8. Red Hat
I encounter the following crash on RHEL 7.0 when I run a multithreaded video rendering application using GLFW and OpenGL. OpenGL version is 2.1 and MESA version is 9.3.0
Following is the back trace of the multi-threaded program I am working on:... (0 Replies)
Discussion started by: anuachin
0 Replies
9. HP-UX
Hi,
This weekend there was a sudden application crash in the server.
I did not know where to start to investigate the problem, so I first looked into the /var/adm/syslog/syslog.log, and this was what I found :
Dec 17 00:38:02 L28bi01 sshd: error: accept: No buffer space available
Dec 17... (9 Replies)
Discussion started by: anaigini45
9 Replies
LEARN ABOUT DEBIAN
zmq_close
ZMQ_CLOSE(3) 0MQ Manual ZMQ_CLOSE(3)
NAME
zmq_close - close 0MQ socket
SYNOPSIS
int zmq_close (void *socket);
DESCRIPTION
The zmq_close() function shall destroy the socket referenced by the socket argument. Any outstanding messages physically received from the
network but not yet received by the application with zmq_recv() shall be discarded. The behaviour for discarding messages sent by the
application with zmq_send() but not yet physically transferred to the network depends on the value of the ZMQ_LINGER socket option for the
specified socket.
Note
The default setting of ZMQ_LINGER does not discard unsent messages; this behaviour may cause the application to block when calling
zmq_term(). For details refer to zmq_setsockopt(3) and zmq_term(3).
RETURN VALUE
The zmq_close() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.
ERRORS
ENOTSOCK
The provided socket was invalid.
SEE ALSO
zmq_socket(3) zmq_term(3) zmq_setsockopt(3) zmq(7)
AUTHORS
This manual page was written by the 0MQ community.
0MQ 2.2.0 04/04/2012 ZMQ_CLOSE(3)