Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting ssh - connection reset by peer Post 302202751 by osxhawk on Thursday 5th of June 2008 02:18:17 PM
Old 06-05-2008
Thanks for the response. Modifying the "Keepalive" option solved the problem.
 

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. 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@122.10.12.45" 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

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

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

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. UNIX for Dummies Questions & Answers

cat: write error: Connection reset by peer

I have created a script to cat the contents of a log file and pipe it to head and tail so I can get specific lines. When I do this I sometimes randomly get the error "cat: write error: Connection reset by peer". It is completely sporatic and sometimes it doesnt happen and sometimes it does... (4 Replies)
Discussion started by: atelford
4 Replies

7. UNIX for Dummies Questions & Answers

Grep: writing output: Connection reset by peer

Hi , when i run , tkt=/u01/ctrlfile/tkt.tmp grep "TICKET NBR" $cdrFile | head -$count | tail -1 > $tkt i got error grep: writing output: Connection reset by peer but some time its working withour error its working fine but some time i got this error any help please (5 Replies)
Discussion started by: OTNA
5 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. 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 user@xxx.xxx.xxx.xxx Connecting to xxx.xxx.xxx.xxx...... (9 Replies)
Discussion started by: dc26
9 Replies

10. 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
POE::Component::Client::Keepalive(3pm)			User Contributed Perl Documentation		    POE::Component::Client::Keepalive(3pm)

NAME
POE::Component::Client::Keepalive - manage connections, with keep-alive VERSION
version 0.271 SYNOPSIS
use warnings; use strict; use POE; use POE::Component::Client::Keepalive; POE::Session->create( inline_states => { _start => &start, got_conn => &got_conn, got_error => &handle_error, got_input => &handle_input, } ); POE::Kernel->run(); exit; sub start { $_[HEAP]->{ka} = POE::Component::Client::Keepalive->new(); $_[HEAP]->{ka}->allocate( scheme => "http", addr => "127.0.0.1", port => 9999, event => "got_conn", context => "arbitrary data (even a reference) here", timeout => 60, ); print "Connection is in progress. "; } sub got_conn { my ($kernel, $heap, $response) = @_[KERNEL, HEAP, ARG0]; my $conn = $response->{connection}; my $context = $response->{context}; if (defined $conn) { if ($response->{from_cache}) { print "Connection was established immediately. "; } else { print "Connection was established asynchronously. "; } $conn->start( InputEvent => "got_input", ErrorEvent => "got_error", ); return; } print( "Connection could not be established: ", "$response->{function} error $response->{error_num}: ", "$response->{error_str} " ); } sub handle_input { my $input = $_[ARG0]; print "$input "; } sub handle_error { my $heap = $_[HEAP]; delete $heap->{connection}; $heap->{ka}->shutdown(); } DESCRIPTION
POE::Component::Client::Keepalive creates and manages connections for other components. It maintains a cache of kept-alive connections for quick reuse. It is written specifically for clients that can benefit from kept-alive connections, such as HTTP clients. Using it for one- shot connections would probably be silly. new Creates a new keepalive connection manager. A program may contain several connection managers. Each will operate independently of the others. None will know about the limits set in the others, so it's possible to overrun your file descriptors for a process if you're not careful. new() takes up to five parameters. All of them are optional. To limit the number of simultaneous connections to a particular host (defined by a combination of scheme, address and port): max_per_host => $max_simultaneous_host_connections, # defaults to 4 To limit the overall number of connections that may be open at once, use max_open => $maximum_open_connections, # defaults to 128 Programs are required to give connections back to the manager when they are done. See the free() method for how that works. The connection manager will keep connections alive for a period of time before recycling them. The maximum keep-alive time may be set with keep_alive => $seconds_to_keep_free_conns_alive, # defaults to 15 Programs may not want to wait a long time for a connection to be established. They can set the request timeout to alter how long the component holds a request before generating an error. timeout => $seconds_to_process_a_request, # defaults to 120 Specify a bind_address to bind all client sockets to a particular local address. The value of bind_address will be passed directly to POE::Wheel::SocketFactory. See that module's documentation for implementation details. allocate Allocate a new connection. Allocate() will return a request ID immediately. The allocated connection, however, will be posted back to the requesting session. This happens even if the connection was found in the component's keep-alive cache. It's a bit slower, but the use cases are cleaner that way. Allocate() requires five parameters and has an optional sixth. Specify the scheme that will be used to communicate on the connection (typically http or https). The scheme is required, but you're free to make something up here. It's used internally to differentiate different types of socket (e.g., ssl vs. cleartext) on the same address and port. scheme => $connection_scheme, Request a connection to a particular address and port. The address and port must be numeric. Both the address and port are required. address => $remote_address, port => $remote_port, Specify an name of the event to post when an asynchronous response is ready. This is of course required. event => $return_event, Set the connection timeout, in seconds. The connection manager will post back an error message if it can't establish a connection within the requested time. This parameter is optional. It will default to the master timeout provided to the connection manager's constructor. timeout => $connect_timeout, Specify additional contextual data. The context defines the connection's purpose. It is used to maintain continuity between a call to allocate() and an asynchronous response. A context is extremely handy, but it's optional. context => $context_data, In summary: $mgr->allocate( scheme => "http", address => "127.0.0.1", port => 80, event => "got_a_connection", context => \%connection_context, ); The response event ("got_a_connection" in this example) contains several fields, passed as a list of key/value pairs. The list may be assigned to a hash for convenience: sub got_a_connection { my %response = @_[ARG0..$#_]; ...; } Four of the fields exist to echo back your data: $response{address} = $your_request_address; $response{context} = $your_request_context; $response{port} = $your_request_port; $response{scheme} = $your_request_scheme; One field returns the connection object if the connection was successful, or undef if there was a failure: $response{connection} = $new_socket_handle; On success, another field tells you whether the connection contains all new materials. That is, whether the connection has been recycled from the component's cache or created anew. $response{from_cache} = $status; The from_cache status may be "immediate" if the connection was immediately available from the cache. It will be "deferred" if the connection was reused, but another user had to release it first. Finally, from_cache will be false if the connection had to be created to satisfy allocate(). Three other fields return error information if the connection failed. They are not present if the connection was successful. $response{function} = $name_of_failing_function; $response{error_num} = $! as a number; $response{error_str} = $! as a string; free Free() notifies the connection manager when connections are free to be reused. Freed connections are entered into the keep-alive pool and may be returned by subsequent allocate() calls. $mgr->free($socket); For now free() is called with a socket, not a connection object. This is usually not a problem since POE::Component::Connection::Keepalive objects call free() for you when they are destroyed. Not calling free() will cause a program to leak connections. This is also not generally a problem, since free() is called automatically whenever connection objects are destroyed. deallocate Cancel a connection that has not yet been established. Requires one parameter, the request ID returned by allocate(). shutdown The keep-alive pool requires connections to be active internally. This may keep a program active even when all connections are idle. The shutdown() method forces the connection manager to clear its keep-alive pool, allowing a program to terminate gracefully. $mgr->shutdown(); SEE ALSO
POE POE::Component::Connection::Keepalive LICENSE
This distribution is copyright 2004-2009 by Rocco Caputo. All rights are reserved. This distribution is free software; you may redistribute it and/or modify it under the same terms as Perl itself. AUTHOR
Rocco Caputo <rcaputo@cpan.org> CONTRIBUTORS
Rob Bloodgood helped out a lot. Thank you. Joel Bernstein solved some nasty race conditions. Portugal Telecom <http://www.sapo.pt/> was kind enough to support his contributions. BUG TRACKER
https://rt.cpan.org/Dist/Display.html?Queue=POE-Component-Client-Keepalive REPOSITORY
http://gitorious.org/poe-component-client-keepalive http://github.com/rcaputo/poe-component-client-keepalive OTHER RESOURCES
http://search.cpan.org/dist/POE-Component-Client-Keepalive/ perl v5.14.2 2012-05-15 POE::Component::Client::Keepalive(3pm)

Featured Tech Videos

All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy