views:

122

answers:

2

Is there openly available headers which can be used to compile linux socket application (using socket/udp/ip headers). they should define structures like sa_family_t,in_port_t

Mandatory is to use Msdev and not cygwin/gcc or mingw compiler.

+2  A: 

You can use the structures and functions declared in winsock.h or winsock2.h from the standard Win32 API. There are some differences from the standard BSD implementation, but for a simple socket-based application the port should be relatively straightforward.

Rob Pelletier
I don't know... there seem to many things to redefine like struct ip, struct udphdr,sa_family_tin_port_t ... They r all missing in win32. May be the application is not so simple after all.
Boris
The major problem you'll encounter is that the Windows `select` call only works on sockets, whereas UNIX applications often rely on being able to pass other file descriptors to `select`.
caf
A: 

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.

dhorn