Sponsored Content
Top Forums Programming when socket know the peer machin has already been down? Post 302344087 by Sedighzadeh on Friday 14th of August 2009 02:44:24 PM
Old 08-14-2009
when socket know the peer machin has already been down?

hi,

I have developed a very simple echo client/server application. I expect whenever i shutdown the server machine, the client peer detects the shutdown.In reality this doesn't happen and client continues to send and receive data.To my surprise, it even recv() returns with value greater than zero! I stops to recv() after a long period! ( about 5 minute later. )

Where is the problem? How can i detect the peer's shutdown?

Thanks in advance,
Behzad
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get the list of process running in the server from the local machin n unix ?

how to get the list of process running in the server from the local machin n unix ? (3 Replies)
Discussion started by: guhas
3 Replies

2. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

3. Solaris

peer-to-peer connection on solaris and windows

hi everyone. As a solaris/unix beginner, I am trying a peer-to-peer connection with my Sun and Windows. Here is my setup: -Windows XP -Sun System (Netra T1) which is connected to the console of the WinXP machine. -Windows XP has wireless connection which enables me to access internet ... (3 Replies)
Discussion started by: graboid888
3 Replies

4. IP Networking

Firewall stopping Peer to Peer File sharing

I am looking for advice on a router. I am new to Linux and am trying to use Limewire and Ktorent and can make no connection. Limewire indicates I have a firewall. I have a Linksys router WRK54G and my guess is that is the problem. I have spent hours upon hours trying to get it to work using info... (0 Replies)
Discussion started by: Paul K
0 Replies

5. UNIX for Dummies Questions & Answers

fatal: Read from socket failed: Connection reset by peer

I get this error when I log in through console: "fatal: Read from socket failed: Connection reset by peer". Can you tell me what this is and why it happens, and how to stop it? Thank you. (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

6. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

7. IP Networking

Problem with Static route through peer to peer connection

Hi, I am trying to add a static route in one of 3 server (S3) so that I can access the main application server (S1). But problem is, the server (S3) where I am trying to add static route is connected with another server (S2) which is in same private network of application server (S1). I have... (9 Replies)
Discussion started by: ImranBD
9 Replies

8. UNIX for Advanced & Expert Users

Fatal: Read from socket failed: Connection reset by peer [preauth]

Hello, I have recently updated my AIX machine from version 6.1.7.5 to 6.1.9.1 and i noticed that the errpt of the server is full of ssh messages like the one below: sshdprocess_id>]: fatal: Read from socket failed: Connection reset by peer Does anyone knows if this a known bug of the ssh... (15 Replies)
Discussion started by: omonoiatis9
15 Replies

9. AIX

Add AIX machin to my windows network

Hi, Can you explain me step by step how can add my aix 6.1 to windows network. Thans:rolleyes: (5 Replies)
Discussion started by: tatab355
5 Replies
shutdown(3XNET) 				   X/Open Networking Services Library Functions 				   shutdown(3XNET)

NAME
shutdown - shut down socket send and receive operations SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ] #include <sys/socket.h> int shutdown(int socket, int how); DESCRIPTION
The shutdown() function disables subsequent send() and receive() operations on a socket, depending on the value of the how argument. PARAMETERS
how Specifies the type of shutdown. The values are as follows: SHUT_RD Disables further receive operations. SHUT_WR Disables further send operations. SHUT_RDWR Disables further send and receive operations. socket Specifies the file descriptor of the socket. RETURN VALUES
Upon successful completion, shutdown() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The shutdown() function will fail if: EBADF The socket argument is not a valid file descriptor. EINVAL The how argument is invalid. ENOTCONN The socket is not connected. ENOTSOCK The socket argument does not refer to a socket. The shutdown() function may fail if: ENOBUFS Insufficient resources were available in the system to perform the operation. ENOSR There were insufficient STREAMS resources available for the operation to complete. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
getsockopt(3XNET), recv(3XNET), recvfrom(3XNET), recvmsg(3XNET), select(3C), send(3XNET), sendto(3XNET), setsockopt(3XNET), socket(3XNET), attributes(5), standards(5) SunOS 5.10 10 Jun 2002 shutdown(3XNET)
All times are GMT -4. The time now is 01:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy