winsockets

How to make an network-ip scan in c++?

I am experimenting with C++ winsockets. I want to create a method with which I can find the server on the network, without knowing it's IP. To do this I simply loop my connect method through IP adresses 192.168.1.0 to 192.168.1.255. However, the time between each connect is quite large, the program tends to wait at the: connect(nBytes, (...

Count the number of packets sent to a server from a client?

So I'm almost done an assignment involving Win32 programming and sockets, but I have to generate and analyze some statistics about the transfers. The only part I'm having trouble with is how to figure out the number of packets that were sent to the server from the client. The data sent can be variable-length, so I can't just divide the ...

I'm looking for syslog client source code

Does anyone have c++ source code to show how to send message to Syslog using winsock api. ...

Is there a wide character version of WSABUF structure in "Microsoft Visual Studio 8\VC\PlatformSDK\Include\WinSock2"

Hi, Is there a wide character version of WSABUF structure in winsock? I want to write Japanese data on the socket. ...

Any gotchas moving TServerSocket app from D5 to D2007?

I've done a brief Google around and found nothing but I feel I ought to ask. I'm not really expecting there to be anything, but would rather ask a question with no answers now than ask the question when it's all going wrong and discover that EVERYONE knew about a 'gotcha'...! To make overall support/development life easier (and to bring...

Hunt down java.net.SocketException: No buffer space available

Hi I have very ugly problem with: java.net.SocketException: No buffer space available (maximum connections reached?) It is client-server app. Client is Windows XP SP2 32b, with two net cards core duo. Java 1.6. u7. Application have couple server socket open for local communication and couple of client socket for rmi to jboss server. ...

Why is AsyncSockets not providing a valid sender in WillClose and DidClose events?

I have written a C# server application which uses Deusty.net AsyncSockets (great project by the way!) and I'm running into a very strange problem. All the events are being processed correctly including DidRead, giving me a valid sender (IP address etc) but when it comes to disconnections, I get a strange situation where the socket data ...

C++ Winsock P2P

Scenario Does anyone have any good examples of peer-to-peer (p2p) networking in C++ using Winsock? It's a requirement I have for a client who specifically needs to use this technology (god knows why). I need to determine whether this is feasible. Any help would be greatly appreciated. EDIT And I would like to avoid using libraries so...

extra newlines at end of file transported over tcp

I have two programs, recvfile.py and sendfile.cpp. They work except that I end up with a bunch of extra newline characters at the end of the new file. I don't know how the extra spaces get there. I know the problem is sender side, because the same doesn't happen when I use python's sendall() function to send the file. Here are the files...

Scanning LAN game servers using winsock

I'm trying to figure out how to use winsockets to be able to turn my game into a LAN-playable game. I've read some winsockets documentation but I can't figure out how a client can get all the games that were created on LAN. Does it have to try to 'connect' to each IP on LAN, like trying to connect to 192.168.0.1, then 192.168.0.2, etc? ...

Overlapped WSARecv() Callback Not Being Called in MFC App

I have a COM component, implemented in C++ with ATL, that uses overlapped socket I/O. Right after the connection is made to the server, it starts an overlapped read on the socket, with code like this: // Pass pointer to this instance as hEvent parameter, for use by callback m_recvOverlapped.hEvent = reinterpret_cast<HANDLE>(this); int...