winsock

Is transmitting a file over multiple sockets faster than just using one socket?

百般思念 提交于 2021-02-07 14:31:13
问题 In this old project (from 2002), It says that if you split a file into multiple chunks and then transmit each chunk using a different socket, it will arrive much faster than transmitting it as a whole using one socket. I also remember reading (many years ago) that some download manager also uses this technique. How accurate is this? 回答1: Given that a single TCP connection with large windows or small RTT can saturate any network link, I don't see what benefit you expect from multiple TCP

Do I need to close a socket?

自闭症网瘾萝莉.ら 提交于 2021-02-06 15:26:13
问题 After sending data over a socket with Winsock, you're supposed to close the connection like this: closesocket(ConnectSocket); WSACleanup(); I'm writing an API that sends data over a socket. If I have to close the socket afterwards, I need to add a function to the API so that users can say when they're done getting data. Is it a problem if I don't close the socket, for convenience? 回答1: One way or another, if you don't close a socket, your program will leak a file descriptor. Programs can

Do I need to close a socket?

房东的猫 提交于 2021-02-06 15:25:37
问题 After sending data over a socket with Winsock, you're supposed to close the connection like this: closesocket(ConnectSocket); WSACleanup(); I'm writing an API that sends data over a socket. If I have to close the socket afterwards, I need to add a function to the API so that users can say when they're done getting data. Is it a problem if I don't close the socket, for convenience? 回答1: One way or another, if you don't close a socket, your program will leak a file descriptor. Programs can

LuaSocket socket/core.dll required location?

柔情痞子 提交于 2021-01-27 18:16:49
问题 When I use local socket = require("socket.core") It works fine, the dll is located at "dir/socket/core.dll" but when I move the dll to say "dir/folder/core.dll" and use local socket = require("folder.core.") It returns that it was found however it could not find the specific module in folder.core. How do I use Luasocket outside of it's socket.core requirements? Thanks! 回答1: If you want to require("socket.core") , the shared library (dll) has to have an exported function called luaopen_socket

Winsock use system proxy settings

依然范特西╮ 提交于 2021-01-27 14:20:32
问题 I have a simple winsock program and I want pass my connection through system proxy. I saw some post that explain how to catch system proxy and then send string like below: CONNECT 127.0.0.1:8080 HTTP/1.0\r\n and so on. But it doesn't work exactly all the time. In other hand, when using WinInet API ( InternetOpen() Function and ... ) it works perfectly. I need solution like WinInet that works correctly always and bidirectional functionality like Winsocket. 回答1: There is no such thing as a

Windows service: Listening on socket while running as LocalSystem

和自甴很熟 提交于 2021-01-27 13:14:40
问题 I'm writing a small server-like program in C for Windows (using MinGW/GCC, testing on Windows 7) which is eventually supposed to run as a service with the LocalSystem account. I am creating a socket, and using Windows Sockets bind() , listen() and accept() to listen for incoming connections. If I run the application from the command line (i.e. not as a service, but as a normal user), I have no problems connecting to it from external IPs. However, if I run the program as a service with the

Statically linking Winsock?

為{幸葍}努か 提交于 2020-12-30 03:48:13
问题 I'm using Winsock 1.1 in my project. I include wsock32.lib in "Additional Dependencies". I'm looking at the DLL project using depends.exe and notice that the DLL depends on wsock32.dll . How can I statically link it so that it doesn't depend on wsock32.dll ? 回答1: The short answer is that you can't. There is no static winsock library, you can only invoke wsock32.dll. Much the same way that you can't statically link to user32 or kernel32. There are things with wsock32.dll internally that are

Statically linking Winsock?

空扰寡人 提交于 2020-12-30 03:44:57
问题 I'm using Winsock 1.1 in my project. I include wsock32.lib in "Additional Dependencies". I'm looking at the DLL project using depends.exe and notice that the DLL depends on wsock32.dll . How can I statically link it so that it doesn't depend on wsock32.dll ? 回答1: The short answer is that you can't. There is no static winsock library, you can only invoke wsock32.dll. Much the same way that you can't statically link to user32 or kernel32. There are things with wsock32.dll internally that are