Visit Our UNIX and Linux User Community

Top Forums UNIX for Dummies Questions & Answers fatal: Read from socket failed: Connection reset by peer Post 302424514 by jim mcnamara on Tuesday 25th of May 2010 12:30:47 PM
Old 05-25-2010
The problem is external to your code.

Assuming a SOCKSTREAM:
It means the connection was forcibly closed by a peer. It a loss of the connection to the remote socket due to a timeout or a restart, the remote process died, a network component died, etc. In TCP terms, the remote host or maybe an intervening component sent an RST packet.

In anthroplogical terms it means the remote host "wants" you to try to connect and then send the packet again. If it was hardware or a process crash you probably won't reconnect but you should try. listen() with a time out, or try a connect() - which ever is appropriate.

Last edited by jim mcnamara; 05-25-2010 at 03:38 PM.. Reason: spelling
Test Your Knowledge in Computers #485
Difficulty: Medium
A computer operating system loads an executable file into a call stack on a hard disk.
True or False?

10 More Discussions You Might Find Interesting

1. IP Networking

connection reset by peer

:confused: HI, We have 2 servers ( win 2003 + sun 5.8 ) and we run a rsh from the NT to the UNIX. The program runs a shell script on the UNIX and waits for the answer in the EOF. How ever, after period of appx 2 min there is a reply "Recv failed:Connection reset by peer". while the... (5 Replies)
Discussion started by: eyalush
5 Replies

2. HP-UX

XIO: fatal IO error 232 (Connection reset by peer) on X server ""

Hi All... I'm newbie here..., i have problem when installing oracle9206, i use HPUX 11.11, i'm using Xmanager enterprise 2.1 for forwarding from server A to my laptop # export DISPLAY= # echo $DISPLAY output ==> at the oracle directory, i execute ... (3 Replies)
Discussion started by: grimanda
3 Replies

3. Shell Programming and Scripting

ssh - connection reset by peer

I use ssh to work on the server (OS X 10.4.x) remotely from home (Debian / OS X 10.5.3). If I leave my machine idle, I get disconnected after a couple of minutes. I get the following error message: Read from remote host "server name": Connection reset by peer Connection to "server name" closed.... (2 Replies)
Discussion started by: osxhawk
2 Replies

4. Shell Programming and Scripting

Connection reset by peer

hi i am connecting to a remote server using sftp protocol. i am using the command like "sftp USER01@" then i got the error "Couldn't read packet: Connection reset by peer" please help its very urgent (5 Replies)
Discussion started by: Satyak
5 Replies

5. IP Networking

connection reset by peer on freebsd

hi all. am running postgresql in a vm on debian server. i have some client programs connecting to the db. when i check the logs of postgresql i see "connection reset by peer" can someone help me with this issue... thanks. (1 Reply)
Discussion started by: coolatt
1 Replies

6. UNIX for Advanced & Expert Users

Connection reset by peer..closing connection

Hello I'm facing the above problem while doing a performance run. I've a script which I'm launching from my windows desktop using mozilla. The script will invoke backend action on a Solaris host which in turn feeds the records to a driver located on a linux box(Cent OS). What's happening is... (1 Reply)
Discussion started by: subramanyab
1 Replies

7. 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 to 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

8. UNIX for Dummies Questions & Answers

Sftp - Couldn't read packet: Connection reset by peer

Hello to all, i have a problem when trying to estabilish a sftp connection. i setup a sftp server (i used feeFTPd) and i'm now trying to connect from two different machines. from the first one everything is fine: $ sftp -vvv Connecting to (9 Replies)
Discussion started by: dc26
9 Replies

9. Red Hat

Can't SSH - Connection reset by Peer

Hi Guys, I can't SSH to a remote system - connection reset by peer..any ideas ? -The Source is Linux, the Remote is Windows -The remote has OpenSSH running on Port 22 - Telnet confirms port is open -User1 has a RSA2 Key (2048) key, which is capture in the 1010101-pub.key specified by the... (1 Reply)
Discussion started by: stevie_velvet
1 Replies

10. Shell Programming and Scripting

Couldn't read packet: Connection reset by peer send: spawn id exp4 not open while executing

Hi All, I am having an issue with my script which I am using to get files from a remote server. In my script I am going to server:- REMOTESERVER and directory:- /Interface/Upload, and then getting files from there to my local server directory:- /ftp/jail_nextview_LMS/home/nextview_LMS/outbox. ... (1 Reply)
Discussion started by: Hero6438
1 Replies
connect(3XNET)					   X/Open Networking Services Library Functions 				    connect(3XNET)

connect - connect a socket SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ] #include <sys/socket.h> int connect(int socket, const struct sockaddr *address, socklen_t address_len); DESCRIPTION
The connect() function requests a connection to be made on a socket. The function takes the following arguments: socket Specifies the file descriptor associated with the socket. address Points to a sockaddr structure containing the peer address. The length and format of the address depend on the address fam- ily of the socket. address_len Specifies the length of the sockaddr structure pointed to by the address argument. If the socket has not already been bound to a local address, connect() will bind it to an address which, unless the socket's address fam- ily is AF_UNIX, is an unused local address. If the initiating socket is not connection-mode, then connect() sets the socket's peer address, but no connection is made. For SOCK_DGRAM sockets, the peer address identifies where all datagrams are sent on subsequent send(3XNET) calls, and limits the remote sender for subse- quent recv(3XNET) calls. If address is a null address for the protocol, the socket's peer address will be reset. If the initiating socket is connection-mode, then connect() attempts to establish a connection to the address specified by the address argument. If the connection cannot be established immediately and O_NONBLOCK is not set for the file descriptor for the socket, connect() will block for up to an unspecified timeout interval until the connection is established. If the timeout interval expires before the connection is established, connect() will fail and the connection attempt will be aborted. If connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() will fail and set errno to EINTR, but the connection request will not be aborted, and the connection will be established asynchronously. If the connection cannot be established immediately and O_NONBLOCK is set for the file descriptor for the socket, connect() will fail and set errno to EINPROGRESS, but the connection request will not be aborted, and the connection will be established asynchronously. Subsequent calls to connect() for the same socket, before the connection is established, will fail and set errno to EALREADY. When the connection has been established asynchronously, select(3C) and poll(2) will indicate that the file descriptor for the socket is ready for writing. The socket in use may require the process to have appropriate privileges to use the connect() function. USAGE
If connect() fails, the state of the socket is unspecified. Portable applications should close the file descriptor and create a new socket before attempting to reconnect. RETURN VALUES
Upon successful completion, connect() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The connect() function will fail if: EADDRNOTAVAIL The specified address is not available from the local machine. EAFNOSUPPORT The specified address is not a valid address for the address family of the specified socket. EALREADY A connection request is already in progress for the specified socket. EBADF The socket argument is not a valid file descriptor. ECONNREFUSED The target address was not listening for connections or refused the connection request. EFAULT The address parameter can not be accessed. EINPROGRESS O_NONBLOCK is set for the file descriptor for the socket and the connection cannot be immediately established; the connec- tion will be established asynchronously. EINTR The attempt to establish a connection was interrupted by delivery of a signal that was caught; the connection will be established asynchronously. EISCONN The specified socket is connection-mode and is already connected. ENETUNREACH No route to the network is present. ENOTSOCK The socket argument does not refer to a socket. EPROTOTYPE The specified address has a different type than the socket bound to the specified peer address. ETIMEDOUT The attempt to connect timed out before a connection was made. If the address family of the socket is AF_UNIX, then connect() will fail if: EIO An I/O error occurred while reading from or writing to the file system. ELOOP Too many symbolic links were encountered in translating the pathname in address. ENAMETOOLONG A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX characters. ENOENT A component of the pathname does not name an existing file or the pathname is an empty string. ENOTDIR A component of the path prefix of the pathname in address is not a directory. The connect() function may fail if: EACCES Search permission is denied for a component of the path prefix; or write access to the named socket is denied. EADDRINUSE Attempt to establish a connection that uses addresses that are already in use. ECONNRESET Remote host reset the connection request. EHOSTUNREACH The destination host cannot be reached (probably because the host is down or a remote router cannot reach it). EINVAL The address_len argument is not a valid length for the address family; or invalid address family in sockaddr structure. ENAMETOOLONG Pathname resolution of a symbolic link produced an intermediate result whose length exceeds PATH_MAX. ENETDOWN The local interface used to reach the destination is down. ENOBUFS No buffer space is available. ENOSR There were insufficient STREAMS resources available to complete the operation. EOPNOTSUPP The socket is listening and can not be connected. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
close(2), poll(2), accept(3XNET), bind(3XNET), getsockname(3XNET), select(3C), send(3XNET), shutdown(3XNET), socket(3XNET), attributes(5), standards(5) SunOS 5.11 10 Jun 2002 connect(3XNET)

Featured Tech Videos

All times are GMT -4. The time now is 04:21 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy