kamrul has asked for the wisdom of the Perl Monks concerning the following question:
After writing the first request on the socket I get response as expected from google server. And I cant print the server response using print But, I dont get any response after writing the second request. It seems like the connection gets closed after the first request and response or something. How do I send multiple request through open TLS connection and receive server responses ?use IO::Socket::SSL; my $client = IO::Socket::SSL->new('gcm.googleapis.com:5236') or die "error=$!, ssl_error=$SSL_ERROR"; print $client '<stream:stream to="gcm.googleapis.com" version="1.0" #xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" +/>'; print <$client>; print $client '<auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">MTI2MjAwMzQ3OTMzQHByb2plY3RzL +mdjbS5hb mFTeUIzcmNaTmtmbnFLZEZiOW1oekNCaVlwT1JEQTJKV1d0dw==</auth>'; if(!<$client>){ print "Auth error\n"; } else { print <$client>; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl IO::Socket::SSL persistent TCP connection
by Anonymous Monk on May 01, 2015 at 22:15 UTC | |
by kamrul (Acolyte) on May 04, 2015 at 18:21 UTC |