简体   繁体   English

将Linux套接字应用程序移植到Windows USins MsDev

[英]Porting linux socket application to windows usins MsDev

Is there openly available headers which can be used to compile linux socket application (using socket/udp/ip headers). 是否有公开可用的头文件,可用于编译linux套接字应用程序(使用socket / udp / ip头文件)。 they should define structures like sa_family_t,in_port_t 他们应该定义类似sa_family_t,in_port_t的结构

Mandatory is to use Msdev and not cygwin/gcc or mingw compiler. 必须使用Msdev,而不是cygwin / gcc或mingw编译器。

You can use the structures and functions declared in winsock.h or winsock2.h from the standard Win32 API. 您可以使用标准Win32 API中在winsock.h或winsock2.h中声明的结构和函数。 There are some differences from the standard BSD implementation, but for a simple socket-based application the port should be relatively straightforward. 与标准BSD实现有一些区别,但是对于简单的基于套接字的应用程序,端口应该相对简单。

As far as I know, there is no easy way to do this. 据我所知,没有简单的方法可以做到这一点。 Windows provides an entirely different set of system calls than linux, as well as a different method for handling sockets. Windows提供了与Linux完全不同的系统调用集,以及用于处理套接字的不同方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM