winsock

What more socket APIs are available? What are the differences between each of these Socket API?

Everyone referred to it as Socket Programming or Network Programming in C and we started using it by using by including sys/socket.h & netinet/in.h. We thought it was 100% true. But question raised in my mind when I saw this book Internetworking With TCP/IP Volume III: Client-Server Programming and Applications, which was available in 4...

Winsock Join MAC ADDRESS Multicast group

Is there a way to join an Ethernet multicast group? All documentation I found is about adding an IP group. I just want to receive the Cisco CDP packet that is sent to the MAC address 01:00:0c:cc:cc:cc. ...

Is sending data via UDP sockets on the same machine reliable?

If i use UDP sockets for interprocess communication, can i expect that all send data is received by the other process in the same order? I know this is not true for UDP in general. ...

[c++winsock2.0]How to abort winsock blocking call ?

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 use non-blocking sockets with select(), but this thread has to wait before checking the new select(). What is the proper way to stop readin...

Issue with gethostbyname on 64-bit Windows

I am trying to migrate some code from 32-bit Windows (XP and Server 2003) to 64-bit Windows 7, and I am having a weird problem with gethostbyname. I'm doing something like this: struct hostent *hp; hp = gethostbyname( host ); After the call to gethostbyname, the pointer hp->h_addr_list is invalid. It has all the right numbers, but i...

gethostbyname fails for local hostname after resuming from hibernate (Vista+7?)

Just wondering if anyone else has spotted this: On some user's machines running our software, occasionally the call to Win32 winsock gethostbyname fails with error code 11004. For the argument to gethostbyname, I'm passing in the result from gethostname. Now the docs say 11004 is WSANO_DATA. None of the descriptions seem to be relevan...

Winsock accept event sometimes stops signaling (WSAEventSelect)

I have a problem with a piece of legacy c++/winsock code that is part of a multi-threaded socket server. The application creates a thread that handles connections from clients, of which there are typically a couple of hundred connected at any one time. It typically runs without a problem for several days (continuously), and then suddenly...

Asynchronous winsock server wrapper, CPU lagging - C++.

Hello! I am trying to write a Server application wrapper, as I would with any application and I've searched for over a week for a at least decent guide or tutorial on asynchronous sockets( this wrapper has to be asynchronous ) and so far what i could do is this: #ifndef _SERVER_H #define _SERVER_H #include "asynserv.h" // header file w...

Stack Overflow exception (0xC00000FD) at winsock select function

Hello, I have an application which makes use of winsock. I/O part is handled on an other thread. And I am using blocking select method for sockets. But the point is that after 5-6 hours,my application gives 0xC00000FD exception, at the line of select function. As far as I know, this exception occurs when there is recursion, or very l...

Good lightweight library for HTTP POST/GET for C?

Hi, I'm planning of creating a Last.FM scrobbler plugin for a music player in Windows. Last.FM submissions API relays on HTTP/1.1 GET and POST. I've never done Internet oriented programming and I've still to know about the HTTP protocol but I'd like to start playing around with it sending and getting some data. I've looked at the Winsoc...

LSP packet modify

Hello, anybody care to share some insights on how to use LSP for packet modifying ? I am using the non IFS subtype and I can see how (pseudo?) packets first enter WSPRecv. But how do I modify them ? My inquiry is about one single HTTP response that causes WSPRecv to be called 3 times :((. I need to modify several parts of this response...

winsock select based server

I need an example of select based server, which receives and sends data from/to a client. I prefer MSDN example but I could not find any on MSDN. There is a good one here; http://tangentsoft.net/wskfaq/examples/basics/select-server.html But my implementation is almost same, except for, I did not set ExceptFDs, it is null. I set select ...

winsock 2. thread safety for simultaneous send's. tcp

is it possible to have multiple threads sending on the same socket? will there be interleaving of the streams or will the socket block on the first thread (assuming tcp)? the majority of opinions i've found seems to warn against doing this for obvious fears of interleaving, but i've also found a few comments that state the opposite. are ...

Why am I losing this byte in the send() function?

Our application is a C server (this problem is for the Windows port of said server) that communicates with a Windows Java client. In this particular instance we are sending data to the client, particularly, the message consists of a 7 byte header where the first 3 bytes all have a specific meaning (op type, flags, etc) and the last 4 by...

Is there a requirement for using WS2_32.dll instead of wsock32.dll when building with MSVC9.0

I'm in the middle of porting some code to be compiled with MSVC 9.0, and one of my coworkers mentioned that we would need to link against WS2_32.dll because now only Winsock 2 was supported. Is there any truth to this? Our code is pretty old and heavily dependent on wsock32.dll, so this requirement could be a huge obstacle for the projec...

nmap ports scan closes udp socket on windows open by ipworks v4

Upon receiving UDP packets from nmap (port scanner), UDP socket that were open by ivrworks (v4) is being closed without any notification. Has anyone encountered such a problem ...

Making (threaded) game server in C++/WinSock

I have a game I am working on in C++ and OpenGL. I have made a threaded server that right now accepts clients (the game) and receives messages from them. Right now the game only sends messages. I want both the game and server to be able to send and receive, but I'm not sure the best way to go about it. I was considering using a thread fo...

C C++ - TCP Socket Class : Receive Problem

Hey, I did my own Socket class, to be able to send and receive HTTP requests. But I still got some problems. The following code (my receive function) is still buggy, and crashing sometimes. I tried debugging it, but it must be somewhere in the pointer arithmetics / memory management. int Socket::Recv(char *&vpszRecvd) { //vpszRecvd =...

Converting C++ TCP/IP applications from IPv4 to IPv6. Difficult? Worth the trouble?

Over the years I've developed a small mass of C++ server/client applications for Windows using WinSock (Routers, Web/Mail/FTP Servers, etc... etc...). I’m starting to think more and more of creating an IPv6 version of these applications (While maintaining the original IPv4 version as well, of course). Questions: What pitfalls might I...

Examples for Winsock?

What do you guys recommend for a resource for winsock? I have an assignment that we have only have a few days to do that needs to send a simple packet using UDP (and receive the same type of packet). I am fairly familiar with C# sockets but nothing with C++. Any tips or resources? ...