Sponsored Content
Top Forums Programming socket system call can not succedd right after application crash. Post 302340317 by Sedighzadeh on Monday 3rd of August 2009 07:54:39 AM
Old 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

Making Socket System Call From Linux Kernel Module?

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

Which application has a TCP socket open

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

segmentation fault in socket application

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

Problem with socket binding - "system" call

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

C++ application halts at popen system call

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

Client/Server Socket Application - Preventing Client from quitting on server crash

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

Configure a range of ports to "socket" system call

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

XCB crash while Video Rendering in multithreded application

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

Sudden application crash in servers

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
curl_multi_assign(3)						  libcurl Manual					      curl_multi_assign(3)

NAME
curl_multi_assign - set data to associate with an internal socket SYNOPSIS
#include <curl/curl.h> CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd, void *sockptr); DESCRIPTION
This function creates an association in the multi handle between the given socket and a private pointer of the application. This is designed for curl_multi_socket_action(3) uses. When set, the sockptr pointer will be passed to all future socket callbacks for the specific sockfd socket. If the given sockfd isn't already in use by libcurl, this function will return an error. libcurl only keeps one single pointer associated with a socket, so calling this function several times for the same socket will make the last set pointer get used. The idea here being that this association (socket to private pointer) is something that just about every application that uses this API will need and then libcurl can just as well do it since it already has an internal hash table lookup for this. RETURN VALUE
The standard CURLMcode for multi interface error codes. TYPICAL USAGE
In a typical application you allocate a struct or at least use some kind of semi-dynamic data for each socket that we must wait for action on when using the curl_multi_socket_action(3) approach. When our socket-callback gets called by libcurl and we get to know about yet another socket to wait for, we can use curl_multi_assign(3) to point out the particular data so that when we get updates about this same socket again, we don't have to find the struct associated with this socket by ourselves. AVAILABILITY
This function was added in libcurl 7.15.5. SEE ALSO
curl_multi_setopt(3), curl_multi_socket_action(3) libcurl 7.54.0 February 03, 2016 curl_multi_assign(3)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy