winsock

Winsock only sending data at program close

Hi, I have a c++/windows program that receives data from another c++ program via a WM_COPYDATA message. It is then supposed to use Sockets/winsock to send this message on to a server written in Java. The client connects to the server fine, but it doesn't seem to be able to send messages in a timely fashion. However, once the client is c...

"Could not deduce template argument" error when using Winsock bind() call with Boost

I'm fairly new to C++, and I'm likely in over my head, but that's the way it goes. I'm working with a fairly large Win32 C++ project that uses Winsock for its network communications. I'm in the process of trying to convert a bunch of its thread management over to boost, but once I added the references to the boost libraries and what-no...

how to use winsock to create an ftp for file transfer?

it is my third question for ftp file transfer between to machine where one machine has a shared folder and i have to access that folder from my machine using ansi-c or can use a third party lib for this purpose, as winsock i am doing this on windows platform the libs should be ansi-c complied that is a requirement.. i am stuck here ...

OSX Equivalent of Winsock LSP

On Windows, it's possible to program an LSP service on top of Winsock which provides the ability to do a lot of manipulation/etc. with networked applications. For instance, some anti virus applications register an LSP and analyse network traffic that way. Is there a friendly way to accomplish the same sort of thing on OSX? ...

Receiving data with Winsock

Right now, I'm programming the networking for my online game, and I'm not really sure what to do about receiving data. The problem is that I can't really guess the packet's size, so I thought of reading just 4 bytes from the packet and converting them to an int to know what's the packet's size. Then I'll just create a buffer in that siz...

Is there any reason for a blocking call to winsock send() function on Vista to return immediately ?

Hi All, Is there any reason for a blocking call to winsock's send() function on Vista to return immediately ? It works with expected delay on XP and below. I'm wondering if this has got anything to do with auto-tuning feature of Vista. Code: char *pBuffer; // pointer to data int bytes; // total size int i = 0, j=0; w...

What is the equivalent to WinSock in the iPhone SDK?

I need to communicate with a hardware device using TCP and with Windows I would use WinSock. What is the equivalent library that I can use from the iPhone SDK? ...

tcp without Winsock

How can i work with tcp connection without Winsock or another external binary? ...

Sockets server design advice

We are writing a socket server in c# and need some advice on the design. Background: Clients (from mobile devices) connect to our server app and we leave their socket open so we can send data back down to them whenever we need to. The amount of data varies but we generally send/receive data from each client every few seconds, so it's q...

Select calls seems to not time out.

HI Folks, I have a threaded C++ program where up to three threads are calling select on a three separate socket descriptors waiting for data to become available. Each thread handles one socket and adds it to the readfds with a timeout of 300 seconds. After select returns if there is data available I'm calling recv to read it. Is ther...

Getting lpfnAcceptEx (accpetex) to block in native C++

Hello, I've been trying to get the lpfnAcceptEX function in Win32 to block on accept. If this is not possible I was wondering if there was a flag I could accpet or some other function that I could wait on. Right now the program is simply continually creating accepted sockets with no connections behind them. Perhaps I am misunderstanding...

When binding a client TCP socket to a specific local port with Winsock, SO_REUSEADDR does not have any effect

I'm binding a client TCP socket to a specific local port. To handle the situation where the socket remains in TIME_WAIT state for some time, I use setsockopt() with SO_REUSEADDR on a socket. It works on Linux, but does not work on Windows, I get WSAEADDRINUSE on connect() call when the previous connection is still in TIME_WAIT. MSDN is...

Post request with WinSock

How can I do a POST (http) request with WinSock/WinSock2 in C language? ...

How can the SO_RCVBUF be smaller than the TCP receive window? (Windows XP)

I have an application using TCP on Windows XP. When I call getsockopt with the SO_RCVBUF option, it reports 8192 bytes. However, Wireshark shows the app advertising a receive buffer of 64K. How is this possible? To have a 64K receive window, doesn't it need a 64K buffer? Are there two different buffers? ...

WinSock client ports and router port forwarding

I have a server application that binds to a port and listens on it. I've set up the router to forward the data on this port to the server. Now, on the client side, I don't actually bind() the socket to any port, and I usually end up with a different port everytime. In that case, how can I prepare the router to forward that port to the c...

Weird send() problem (with Wireshark log)

I had another question about this issue, but I didn't ask properly, so here I go again! I'm sending a file by sending it in chunks. Right now, I'm playing around with different numbers for the size of that chunk, to see what size is the most efficient. When testing on the localhost, any chunk size seems to work fine. But when I tested ...

Returning from dll (Asynchronous sockets)

I am trying to do a simple http-server in (c++) dll-file that I can use from managed (C#) application with P/Invoke. I was trying to do this with asynchronous functions (WSAAsyncSelect() and stuff), so that I could manage server by calling functions inside dll whenever needed and after that it would return to my main program. Now I'm not...

WSACONNREFUSED when connecting to server

I'm currently working on a server. I know that the client side is working (I can connect to www.google.com on port 80, for example), but the server is not functioning correctly. The socket has socket()ed, bind()ed, and listen()ed successfully and is on an accept loop. The only problem is that accept() doesn't seem to work. netstat sh...

Atomicity guarantees on Winsocks?

As Windows doesn't provide UNIX domain sockets, I am using a a local TCP connection to simulate the behaviour. Now, POSIX guarantees that if several threads are writing to the UNIX domain socket in parallel, chunks up to PIPE_BUF will be handled atomically - i.e. no interleaving will happen. Is there are similar guarantee on local TCP wi...

how to get an SDP record for bluetooth service??

Hi I'm new to both winsock and bluetooth programming. I need to develop a bluetooth service to run on a pc. Looking at the MSDN library they say to use WSASetService(http://msdn.microsoft.com/en-us/library/aa362921%28VS.85%29.aspx) function to publish a service. The problem is that the WSAQUERYSET(http://msdn.microsoft.com/en-us/librar...