[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Working on keepalive messages while waiting for local connection
[Thread Prev] | [Thread Next]
- Subject: Re: Working on keepalive messages while waiting for local connection
- From: Andreas Schneider <asn@xxxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 11 Apr 2018 17:31:26 +0200
- To: libssh@xxxxxxxxxx
On Wednesday, 11 April 2018 16:27:16 CEST g4-lisz@xxxxxxxxxxxx wrote: > Hello all > > I realized that SSH servers with the keep-alive option enabled first > send the keep-alive _global_ request as long as nothing had connected to > the local TCP socket: > > $> ssh -v -N xxx@yyy -L 8088:testcom.com:80 > > debug1: client_input_global_request: rtype keepalive@xxxxxxxxxxx > want_reply 1 > > After connecting to localhost:8088, these requests are sent over the > channel: > > debug1: client_input_channel_req: channel 2 rtype > keepalive@xxxxxxxxxxx reply 1 > > From this I conclude that the channel should not be opened before there > is a waiting connection on the local TCP socket. > But how do I tell libssh to work on the global request as long as there > is no open channel? > > Maybe I have to use ssh_get_fd() and the use select() also on this > socket while waiting for the local incoming connections? And then use > ssh_set_fd_toread()? > > I would appreciate a lot if someone could show me some sample code. I think that ssh_event_dopoll() will handle it and call the appropriate callback. Don't use ssh_select() In master we have the new connector API which is easier to use, see https://git.libssh.org/projects/libssh.git/tree/examples/ssh_client.c -- Andreas Schneider GPG-ID: CC014E3D www.cryptomilk.org asn@xxxxxxxxxxxxxx
Re: Working on keepalive messages while waiting for local connection | g4-lisz@xxxxxxxxxxxx |
Working on keepalive messages while waiting for local connection | g4-lisz@xxxxxxxxxxxx |
Re: Working on keepalive messages while waiting for local connection | g4-lisz@xxxxxxxxxxxx |