Windows socket 2和Windows 8 metro应用程序 [英] Windows socket 2 and Windows 8 metro app

查看:94
本文介绍了Windows socket 2和Windows 8 metro应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是开发网络应用的新手。我目前正在为Windows 8开发metro应用程序。 

I am new to develop network app. I am currently developing metro app for Windows 8. 

我有一个使用winsock api来支持原始套接字的DLL。我发现Windows 8 metro应用程序不支持winsock。

I have a dll that use winsock api to support raw socket. I found out that winsock is not supported on Windows 8 metro app.

因此我打算使用Windows.Networking.Sockets在C ++中重新编写自己的dll。

So I am planning to re-write my own dll in C++ using Windows.Networking.Sockets.

我的问题是......

My questions are...

(1)如下所示制作套接字对象的替代函数是什么。

(1) What is the alternative function to make socket object like below.

< span style ="white-space:pre"> sock = socket(iFamily,iType,iProtocol);

sock = socket(iFamily, iType, iProtocol);

(2)连接的替代功能是什么。

(2) What is the alternative function to connect.

connect((SOCKET)sockfd,(SOCKADDR *)& addr,sizeof(SOCKADDR_IN);

connect((SOCKET)sockfd, (SOCKADDR*)&addr, sizeof(SOCKADDR_IN);

如果有人可以提供我可以参考的样本或网页,我们将非常感激。

It would be appreciated if someone could provide me samples or webpage I can refer.

非常感谢!

推荐答案

看一下
DatagramSocket示例

StreamSocket示例
,具体取决于您需要使用的套接字类型。

Take a look at the the DatagramSocket sample and the StreamSocket sample , depending on what type of socket you need to use.

另请参阅
连接到同级,Web和网络服务
,以获取非套接字特定的网络支持概述。

连接到网络服务
是特定于插座的子部分。

Also see Connecting to peers, web and network services for a non-socket specific overview of networking support. Connecting to network services is the socket specific sub-section.

- Rob


这篇关于Windows socket 2和Windows 8 metro应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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