Re: [openssl-users] Response from server is lost on close

2015-12-09 Thread Anty Rao
Hi Michael, Thanks for your reply, and appreciate your answer which clear many of my doubts. Currently i'm stuck with this problem, can't find a way out,let me give more context of my problem. I use non-blocking openssl to interact with Apple's APNS server to send notifications to Iphone devices.

Re: [openssl-users] Response from server is lost on close

2015-12-09 Thread Michael Wojcik
(Sorry for the delay in replying - I was tied up with other things.) Yes, you're correct. I was misremembering, and should have checked references first. The BSD implementation that Gary Wright and Rich Stevens describe in TCP/IP Illustrated v. 2 drops queued outbound data (on both sides) and q

[openssl-users] Response from server is lost on close

2015-12-09 Thread Anty Rao
Hi : ALL Using non-blocking openssl , after detecting underlying TCP is broken, i invoke SSL_read to attempting reading response. *sometimes* response from server is lost, sometimes not. But tcpdump show that response is always send back to me. what is special is that RST packages come next the res

Re: [openssl-users] Response from server is lost on close

2015-12-03 Thread Anty Rao
Hi, yes, tcp is free to discard receive buffer on receiving RST however after looking through the source code of linux kernel, it seems that process just set state of socket, not discard data in receive buffer. 1. tcp_validate_incoming 5184 /* Step 2: check RST bit */ 5185 if (th-

Re: [openssl-users] Response from server is lost on close

2015-12-02 Thread Anty Rao
Thanks Jakob & Michael for your reply. I'm using openssl to interact with apple's APNS server. Sending data as fast as possible, most of the time APNS server don't reply, but in some circumstance, APNS server will rely with a response and then close the connection. So the RST is expected most of th

Re: [openssl-users] Response from server is lost on close

2015-12-02 Thread Michael Wojcik
Just to amplify on Jakob's response: the reason that sometimes you see the reply is that sometimes your application manages to get it from the stack before the stack receives and processes the RST from the peer. In the example you provided, there was a 52ms window in which you could have read th

Re: [openssl-users] Response from server is lost on close

2015-12-02 Thread Jakob Bohm
On 02/12/2015 11:21, Anty Rao wrote: Using non-blocking openssl , after detecting underlying TCP is broken, i invoke SSL_read to attempting reading response. *sometimes* response from server is lost, sometimes not. But tcpdump show that response is always send back to me. what is

Re: [openssl-users] Response from server is lost on close

2015-12-02 Thread Anty Rao
> > Using non-blocking openssl , after detecting underlying TCP is broken, i > invoke SSL_read to attempting reading response. *sometimes* response from > server is lost, sometimes not. But tcpdump show that response is always > send back to me. what is special is that RST packages come next the >