Link to home
Start Free TrialLog in
Avatar of gregasm
gregasm

asked on

PInvoke winsock WSAStartup and WSACleanup in c#

Can someone show me code to PInvoke WSAStartup and WSACleanup in c#? or point me to a web site that has sample code on how to do this? It would be really appreciated. Thanks
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gregasm
gregasm

ASKER

Awesome!!!
looks like you're in for a fun weekend !
Avatar of gregasm

ASKER

One more quick question on this... referring to my question here:
https://www.experts-exchange.com/questions/21013998/Invoking-a-c-library-from-NET.html

I can call SocketInitialize which does PInvoke on WSAStartup, and then Pinvoke the methods inside the c++ assembly symcsapi.dll.. and the methods inside symcsapi.dll ScanStartup will work because they require the Winsock is initialized, which it is.

And after I am done with the methods inside symcsapi.dll, I can just call WSACleanup.

is my understanding correct?
Avatar of gregasm

ASKER

yes, I am definitely looking forward to a fun weekend. What with all my remoting projects and now my Interop escapades...  thanks for all your help!!!
it should.