HarunBahcel / apns-sharp

Automatically exported from code.google.com/p/apns-sharp
0 stars 0 forks source link

Maintaining persistant connection #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Modified the code to attempt to hold open the stream instead of having to
recreate and re-authenticate.

What is the expected output? What do you see instead?
Expect to be able to continue writing to the stream, but instead the host
closes the stream after the first message.  Apple specification states that
connection should be kept open rather than opened for each message.

Solution:
Buffer only the number of bytes necessary.  If you create the buffer of the
full length instead of a length corresponding to the actual length, if you
don't fill it you have null bytes remaining at the end.  Two null bytes in
a row will cause the host to close your connection.

Original issue reported on code.google.com by IDIEE...@gmail.com on 10 Sep 2009 at 1:30

GoogleCodeExporter commented 8 years ago
This is now fixed

Original comment by jond...@gmail.com on 22 Dec 2009 at 5:48