cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Getting the error Failed to get recent socket, Unsupported protocolwhile establishing HTTPS connection

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Mon, 5 Mar 2012 13:51:22 +0100

 
ankit Tripathi wrote:
> 2)"Unsupported protocol " .while waiting on socket for the receiving
> first it wait around 15 to 20 sec and then it trows the error.i am
> providing here the test application in which i am making https
> connection with google.com. after waiting on socket for 15-20 sec
> it throws the error 1)" Failed to get recent socket "
> 2)"Unsupported protocol " .i tried to googling but i didn't found
much.

I suppose Google closed the connection while you are sleeping on
select(): there are odd things in your program that make me think so:

1) Your select() call monitors for events but neither for input nor for
output.
2) You do not send data between connection and wait+read: the http(s)
protocol states (apart from SSL handshake) that the client must "speak"
first.
3) As a consequence, the only way to leave procedure wait_on_socket() is
to get an event on that socket, or after 60sec... But Google is not so
patient ;-) so you get your event telling that Google has closed the
connection.

I hope it helps.
Cheers,
Patrick

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-05