TCP服务器接受来自Windows Phone的连接 [英] TCP server to accept connection from windows phone

查看:65
本文介绍了TCP服务器接受来自Windows Phone的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照此链接创建了适用于Windows Phone的客户端应用,该应用将连接到TCP服务器>

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&sqi=2&ved=0CEQQFjAC&url= HTTP%3A%2F%2Fmsdn.microsoft.com%2Fen-我们%2Flibrary%2Fwindowsphone%2Fdevelop%2Fhh202858(v%的3Dvs.105)的.aspx&安培; EI = 82lLUeLpFoiIrAff7IHgAQ&安培; USG = AFQjCNGm_J9H10KucArVkkgEX2l4I2Oxww&安培; SIG2 = 9TK79y_k26tdT2qBYSMKfQ&安培; BVM = bv.44158598 ,d.bmk

i have followed this link to create a client app for windows phone which will connect to a tcp server>

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&sqi=2&ved=0CEQQFjAC&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fwindowsphone%2Fdevelop%2Fhh202858(v%3Dvs.105).aspx&ei=82lLUeLpFoiIrAff7IHgAQ&usg=AFQjCNGm_J9H10KucArVkkgEX2l4I2Oxww&sig2=9TK79y_k26tdT2qBYSMKfQ&bvm=bv.44158598,d.bmk

现在我想用C#编写一个TCP服务器以从Windows Phone应用程序接收此连接,该怎么做?

now i want to write a tcp server with c# to receive this connection from windows phone app,,how to do it?

推荐答案

我刚刚在我们的博客中发布了示例代码:

I just posted sample code in our blog:

Windows Phone 8中的数据报套接字通信

它演示了链接的两端,并通过WiFi连接了两个电话.

It demonstrates both sides of the link, hooking two phones up via WiFi.

您引用的链接使用System.Net.Sockets(WP 7.1).

The link you reference uses System.Net.Sockets (WP 7.1).

对于WP 8.0应用程序,建议使用Windows.Networking.Sockets.您需要用它来编写服务器端连接.

For WP 8.0 apps, Windows.Networking.Sockets is recommended; you need it for writing a server-side connection.

希望这会有所帮助,
标记

Hope this helps,
Mark


这篇关于TCP服务器接受来自Windows Phone的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆