APNS APPLE C# sslstream 响应
我想使用 Apple 的 APNS 和 ac# 服务。服务运行完美。 我想要的是苹果的反馈,如果我把平底锅寄给苹果的话。 所以我需要的是来自 sslstream 的反馈。
有人可以帮助我并告诉我如何从 sslstream 中的服务器获得反馈吗?
预先感谢
以下是我如何将平底锅发送到苹果服务器的代码:
TcpClient client = new TcpClient(hostname, APNS_PORT);
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback(ValidateServerCertificate),
null
);
sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls, true);
sslStream.Write(array);
sslStream.Flush();
i want to use APNS from Apple with a c# service. The service runs perfect.
What i wanna have is the feedback from Apple if have send the pans to apple.
So what i need is the feedback from a sslstream.
Can anybody help me and tell me how i gat a feedback from the server within the sslstream ?
Thanks in advance
Here is my code how i send sthe pans to the apple server :
TcpClient client = new TcpClient(hostname, APNS_PORT);
SslStream sslStream = new SslStream(
client.GetStream(),
false,
new RemoteCertificateValidationCallback(ValidateServerCertificate),
null
);
sslStream.AuthenticateAsClient(hostname, certificatesCollection, SslProtocols.Tls, true);
sslStream.Write(array);
sslStream.Flush();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从这个苹果链接:
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html
我假设您刚刚从流中读回,但我自己还没有开始工作。
我尝试发送格式错误的请求来响应数据包,但是我的读取调用被阻止,似乎在等待 ANPS 响应。
From this apple link:
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html
I assume you just read back from the stream, however I haven't gotten this working yet myself.
I've attempted sending malformed requests in an effort to reponse packet, however my read call gets blocked, seemingly waiting for the ANPS to respond.
我从 APNS Sharp 获得了这些代码。
其中apnsStream就像您的sslStream。我相信这些事件可能是您正在寻找的反馈。
I got these code from APNS Sharp.
Where apnsStream is like you sslStream. I believe that those events could be the feedback that you are searching.