0

I have a problem with a C#-application that makes use of a DLL which itself opens a TCP/IP connection. My problem: this DLL does not work when called from C#.

I know from other application a function WSAStartup() has to be called to initialize Winsock.

Is something similar necessary for C#?

Thanks!

MD XF
  • 7,860
  • 7
  • 40
  • 71
Elmi
  • 5,899
  • 15
  • 72
  • 143
  • in `.NET` you have an [`TcpClient`](https://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx) – VMAtm Apr 24 '15 at 16:18
  • 1
    Have you tried adding a p/invoke call to `WSAStartup`? See http://www.pinvoke.net/default.aspx/ws2_32/WSAStartup.html - you'll also need to define a WSAData struct for the out param, see http://www.pinvoke.net/default.aspx/Structures/WSADATA.html – E. Moffat Apr 24 '15 at 16:22

0 Answers0