Questions tagged [winsockets]
78 questions
10
votes
2 answers
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…

Goober
- 13,146
- 50
- 126
- 195
8
votes
3 answers
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…

pnemec
- 467
- 1
- 5
- 11
6
votes
4 answers
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…

Lost Developer
- 65
- 2
- 5
4
votes
3 answers
recv() until a NUL byte is received?
I'm trying to receive a single packet at a time from the server, since packets are going too fast, and each is of undefined size, calling recv() with number of bytes to read will read the first packet and maybe a part of the second packet. Since…

killercode
- 1,666
- 5
- 29
- 42
4
votes
2 answers
Winsock RIO: RIOReceive returns immediately with no bytesTransferred
I'm having problems with getting winsock RIO working.
It seems that every time I post a RIOReceive it returns immediately with 0 bytes transferred, and my peer can't get a message through.
After posting a RIOReceive, I wait on the…

Michael220
- 193
- 12
4
votes
3 answers
Receiving strange characters/symbols in winsock
Im learning about Winsock and Im having a strange issue when sending and receiving a simple string. Here's my code (pure C):
Client:
//...
//Declarations and stuff
//----------- SEND SOME DATA -------------------------------------------------
…

SergiGS
- 51
- 1
- 6
3
votes
2 answers
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…

robsoft
- 5,525
- 4
- 35
- 47
3
votes
1 answer
PChar Invalid Pointer Operation on StrPLCopy
I write some TCP-server usin WinSock 2 and I hava procedure which catch FD_READ event. In this procedure I need to parse recieved message. The code is here:
procedure TfrmMain.WndProc_OnWSANetEvent(var Msg: TMessage);
Var
iCurrThread, n :…

Dmitry Belaventsev
- 6,347
- 12
- 52
- 75
3
votes
0 answers
Compiling socket code for both Windows and Linux
I am writing a C++ program that uses sockets. I want my program to run on both Windows and Linux.
On Windows, I need to use:
Winsock2.h
On Linux, I need to use:
arpa/inet.h
How can I define my C++ program to run on different platforms, and…

Thuong Tran
- 55
- 7
3
votes
2 answers
Sockets and multiple IP Addresses
I have two internet cards on my machine configured with two separate ip addresses. Both ip addresses are part of the same network. Am I right in saying that when I create a socket that it is specific for one of these ip addresses?
UPDATE:
Here's my…

Baz
- 12,713
- 38
- 145
- 268
2
votes
1 answer
Automatically reconnecting asynchronous socket client
I'm working with a windows form application in C#. I'm using a socket client which is connecting in an asynchronous way to a server.
I would like the socket to try reconnecting immediately to the server if the connection is broken for any reason.
My…

Francesco
- 964
- 2
- 17
- 41
2
votes
1 answer
Accepting TCP Connections from Exactly 2 IP Addresses
I am writing a TCP server application using Winsock. The client that connects to me (for which I have no source and therefore cannot make changes) behaves as follows: If it connects and I close the connection (because it is an undesired client), it…

Dave
- 1,519
- 2
- 18
- 39
2
votes
1 answer
Sending files over TCP sockets C++ | Windows
I want to send files over TCP sockets in C++ on Windows, all is working absolutely fine, however I can't send big files like this, I understand that TCP as any protocol has it's limitations, like I can't send more than 64KB per packet, my method…
user14089077
2
votes
1 answer
C++ server with recv/send commands & request/response design
I'm trying to create a server with blocking sockets (one new thread for each new client). This thread should be able to receive commands from the client (and send back the result) and periodically send commands to the client (and request back the…

Alex xelA
- 85
- 9
2
votes
0 answers
10022 Completion Status on RIOSend
I'm trying to get a RIO server going for serving up requested data to a client, but every time I try to do a RIOSend, no data is transferred, and I get a 10022 completion status. I can receive requests and unpack them just fine, it just seems to be…

MetalHeel
- 21
- 1