Questions tagged [wsastartup]

WSAStartup function is used by process to initiate use of the Winsock DLL

53 questions
4
votes
1 answer

Issues when using WSAAddressToString

QUESTION : I'm trying to use WSAAddressToString function to get the ip address of the computer .I went through the msdn documentation in their website and there are too many structures within structures and i feel that's the place where i'm going…
Santhosh Pai
  • 2,535
  • 8
  • 28
  • 49
3
votes
1 answer

C# All Sockets Go Down

I'm trying to understand what can cause all sockets for a given applicaiton to go down / close and fail to open again. My application has multiple sockets (http, ftp, etc.) and will run for some time, though at some point (somewhat deterministic),…
Ternary
  • 2,401
  • 3
  • 31
  • 54
3
votes
1 answer

Detecting local IP address under FireMonkey3

Need to detect local IP address under FireMonkey3. In VCL version, I have been using unit WinSock with methods for it WSAStartup(...) gethostname(...) One limitation: don't need to use any third-party library. I am porting ASTA components to…
Oleksandr
  • 319
  • 1
  • 6
  • 15
2
votes
2 answers

PowerShell IIS:\ WebAdmin Remote Invocation triggers WSAStartup error, WSANOTINITIALISED

I'm using PSRemoting with the WebAdministration module to get info about various sites, and it's working. I am, however, receiving an annoying non-fatal COM exception during invocation of the command, and wondering if anyone else has resolved it.…
codepoke
  • 1,272
  • 1
  • 22
  • 40
2
votes
1 answer

boost::asio::io_service throws exception

Okay, I seriously cannot figure this out. I have a DLL project in MSVC that is attempting to use Asio (from Boost 1.45.0), but whenever I create my io_service, an exception is thrown. Here is what I am doing for testing purposes: void run() { …
DSB
  • 417
  • 1
  • 4
  • 8
2
votes
1 answer

how to replace WSAStartup( MAKEWORD(2, 2), &data ); with boost:asio?

I have native dll project which I use from C# via CLI wrapper. In Initialize method of dll i'm calling WSAStartup(MAKEWORD(2, 2), &data); This works fine. Now I"ve decided to move entire dll to boost::asio (because I will port it to Linux and I…
Oleg Vazhnev
  • 23,239
  • 54
  • 171
  • 305
2
votes
1 answer

What does "Either the application has not called WSAStartup, or WSAStartup failed" mean?

I am trying to develop software that connects to a web-server through a network; everything works fine until trying to use a dongle to protect my software. My dongle has some network feature and it's API work under network infrastructure. wWhen I…
Am1rr3zA
  • 7,115
  • 18
  • 83
  • 125
1
vote
2 answers

Reading certificate hash from remote server

I receive an error when trying to get a certificate hash from a remote machine using the following code: private string getCertHash(string Hostname) { string result = ""; using (ServerManager serverManager =…
FullByte
  • 149
  • 1
  • 2
  • 12
1
vote
2 answers

Using boost::shared_ptr with WSACleanup

I would like to use a boost::shared_ptr in order for WSACleanup() to be called when my function goes out of scope, like this: void DoSomething() { WSAStartup(...); boost::shared_ptr WSACleaner(static_cast(0),…
tsotso
  • 322
  • 1
  • 2
  • 9
1
vote
1 answer

Using sockets winapi with Qt

I am using an API of communicating with remote server and it's only available in C. I cannot rewrite it, because it's a very specific protocol, and it'll take too much effort. The API providedIt uses standard Winsock2 scheme. So, in order to work…
Ivan
  • 21
  • 2
1
vote
1 answer

WSAStartup error (10093) when calling exiftool through PyExifTool

I have installed PyExifTool (https://smarnach.github.io/pyexiftool/). The installation was successful. However, when I try to run the example code provided there: import exiftool files = ["test.jpg"] with exiftool.ExifTool() as et: metadata =…
Warren Blumenow
  • 673
  • 2
  • 11
  • 17
1
vote
1 answer

What happens if multiple WSAStartup calls requesting different WinSock versions occur in a process?

WSAStartup() can be called multiple times in a single process, as long as the requested version is supported by the WinSock dll and that calls to WSAStartup() and WSACleanup() are balanced. In addition to that, Multiple sockets using different…
Guett31
  • 258
  • 2
  • 15
1
vote
0 answers

HttpWebRequest / WSAStartup issue

I have some managed C# code which is accessed on a thread from C++ through COM. When I make an HttpWebRequest in my C# code it initially works, if I deactivate some of the code on the C++ side. However, when I reactivate all the C++ code, then my C#…
evilfred
  • 2,314
  • 4
  • 29
  • 44
1
vote
1 answer

couldn't connect to socket (WSANOTINITIALISED, WSAStartup() has not been called) error while running program

I have this test class which try to connect with open office. import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.comp.helper.Bootstrap; import com.sun.star.lang.XMultiComponentFactory; import…
Ngupta
  • 319
  • 4
  • 19
1
vote
4 answers

WSAStartup with RAII

RAII does't execute destructor when call exit.So WSACleanup doesn't run.What's the problem?I found libnet use WSAStartup without any WSACleanup, why? WSAStartup can call many times in one process, so how can ensure WSACleanup enough? How to use…
qianchenglong
  • 474
  • 5
  • 13