winsock Questions

2

This simple piece of code in Windows results in an annoying debug message printed by gethostbyname. #include <stdio.h> #include <winsock.h> int main() { WSADATA wsaData; WSAStartup(MA...
Pentecostal asked 13/1, 2022 at 9:46

5

Solved

I'm using Visual Studio 2015 and attempting to compile code that has worked before I updated from VS 2013. 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNI...
Izzy asked 18/4, 2016 at 0:37

3

I use Winsock 2 in C++, and wonder how to make my server stop reading from the client connection. The reading thread gets blocked in recv() and I have no idea how to abort it. One way to do this is...
Morton asked 25/1, 2010 at 10:14

4

Solved

I have been getting this error for quite some time now and Google has not been of much help either. I am a newbie to Winsock programming and trying to learn from online resources. I am trying to b...
Moncada asked 7/3, 2011 at 13:16

3

IMPORTANT NOTE: I'm aware that UDP is an unreliable protocol. But, as I'm not the manufacturer of the device that delivers the data, I can only try to minimize the impact. Hence, please don't post ...
Fajardo asked 4/9, 2019 at 13:47

6

Solved

i've stuck in a problem that is never heard about before. i'm making an online game which uses UDP packets in a certain character action. after i developed the udp module, it seems to work fine. t...
Photomap asked 11/1, 2011 at 7:49

2

Solved

Windows handles can be set to be either inheritable or not, to control whether child processes will receive them (when bInheritHandles in CreateProcess is TRUE). However, using SetHandleInformation...
Broomfield asked 21/8, 2012 at 16:7

3

Solved

So I've been looking into overlapped IO for sockets for a server application I'm building, and I keep seeing comments of people saying "never use hEvent" or "IO completion ports will be faster", et...
Margit asked 20/6, 2017 at 23:26

3

I am trying to create a UDP multicast socket program using VS2015 (C++ console application). I got the following error, Error C4996 'inet_addr': Use inet_pton() or InetPton() instead or define ...
Coati asked 26/8, 2015 at 18:44

6

Solved

I've just started learning winsock through the "Beej's guide to network programming" book. I'm programming under windows and running it through gcc. This is just a start to writing my first server ...
Ilowell asked 22/11, 2010 at 6:56

6

I'm using 2 computers with an application to send and receive udp datagrams. There is no flow control and ICMP is disabled. Frequently when I send a file as UDP datagrams via the application, I get...
Morganne asked 19/9, 2010 at 9:14

5

Solved

I'm currently working on a UDP socket application and I need to build in support so that IPV4 and IPV6 connections can send packets to a server. I was hoping that someone could help me out and po...
Linneman asked 24/10, 2009 at 15:15

5

Solved

I am creating a UDP socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP) via Winsock and trying to recvfrom on this socket, but it always returns -1 and I get WSAEINVAL (10022). Why? When I bind() the port, ...
Watkins asked 16/6, 2010 at 20:44

1

Solved

I'm trying to make a client which can send custom packets to a server using raw sockets. I've had success with udp packets but when I try to switch to tcp ones, wireshark doesnt catch anything. I h...
Zelig asked 1/7, 2022 at 20:13

3

Solved

I am writing a cross-platform library which, among other things, provides a socket interface, and while running my unit-test suite, I noticed something strange with regard to timeouts set via setso...
Chumley asked 4/6, 2011 at 1:30

2

Solved

I use file descriptors to find the readable sockets and go on to read. For some reasons, a socket that has no data on the wire, goes on to read and never returns. Is there a way I can come out of t...
Enfranchise asked 20/7, 2011 at 0:15

3

Solved

In my C++ class, I use sockets. I have some errors when linking because, in my opinion, the library winsock.lib is missing. I included these: #ifdef WIN32 #include <winsock.h> typedef i...
Ternan asked 12/2, 2012 at 15:16

2

Solved

I am new to ZMQ. I find ZMQ socket implementation much simpler than winsock. But my doubt is that "can a client created using ZMQ TCP socket talk to conventional TCP server?" in other words Can my ...
Lir asked 26/8, 2014 at 4:49

1

Solved

I am using timeout for sending and receiving data on a socket. I found that timeout can be achieved either by setting socket to non-blocking mode and using select or by using setsockopt with SO_SND...
Ctn asked 8/6, 2021 at 6:16

3

Solved

I'm including as it's required by the MySQL C library. The auto-complete in VS2010 is also showing a - any idea what this is? Are they interchangeable, and are there any advantages of one over th...
Hyperaesthesia asked 5/2, 2012 at 23:2

0

Our software (Nmap port scanner) needs to quickly determine the status of a non-blocking TCP socket connect(). We use select() to monitor a lot of sockets, and Windows is good at notifying us when ...
Conclusion asked 31/8, 2020 at 19:3

2

I want to write a client/server application, in which client and server can exchange messages. Client site communication: send recv send recv Server site communication: recv send recv send How...
Undertow asked 19/6, 2020 at 16:49

2

So, i am trying to make a c++ WinSock2 chatter, just for learning. It is a console application and i want to take user input (for sending to the counterpart), but i still want to be able to recive....
Helen asked 27/12, 2015 at 11:6

3

I'm using ForcebindIP to point an app at a specific network adapter, like this: forcebindip -i 192.168.0.5 MyCSharpApp.exe This works fine and the app isn't aware (or doesn't access) any of the ...
Kamat asked 23/10, 2019 at 11:26

5

I am using Code::Blocks, MinGW, and Windows. Im trying to initialize the winsock so that I can work on a project. I keep getting the error Undefined Reference to WSAStartup@8 Anyone know how to go ...
Robbi asked 20/12, 2015 at 19:15

© 2022 - 2025 — McMap. All rights reserved.