Questions tagged [winsockets]
78 questions
1
vote
2 answers
what could be the reason my message is received with extra characters?
I'm trying to make a program that sends information (set of characters) to another program (client/sever) with winsock for my school project.
the message I send is received on the other side, but with extra characters at the end. I.E. if I wanted to…

Mohe TheDreamy
- 387
- 8
- 21
1
vote
2 answers
Accept call does'nt block the second time (or more than one time)?
I have the following code and I`m not sure why wont it work properly .
Its a multithreaded TCP server that loops accept() calls and triggers a designated
thread each time .
The problem is that the accept at times wont block , thus resulting
the…

Danny Shemesh
- 67
- 1
- 9
1
vote
1 answer
Winsock - Reconnecting client to server basics - TIME_WAIT
I have a TCP server/client set up and they communicate the way I generally want.
What I want to do now is add functionality that would allow the client to automatically reconnect to the server once a connection is lost. I'm having trouble finding…

Soran
- 391
- 1
- 4
- 21
0
votes
0 answers
Scan executable code to find where sockets are opened
I would like to create a software 'scanner' that finds in executable code (e.g. not source code) such as machine code, java jars, etc where sockets are opened.
Does such a thing exist? If not, is there a means to find how the library is linked and…
0
votes
1 answer
Winsocks 2 Asynchronous Problem
I am trying to use winsock2 in asynchronous mode. I am able to send messages from client to server, but not from server to client. When I call recv on client side, nothing is received in the buffer.
Here is my client code
ClientSocket::ClientSocket…

Sumit Jain
- 1,484
- 2
- 25
- 44
0
votes
1 answer
Preprocessor check for availability of Winsockets / BSD sockets
I'm new to socket programming and want to make a cross platform app (C++) that supports both windows and unix systems.
The default on for websocket transport on Windows seems to be windows sockets while on unix systems it's BSD sockets. So how can I…

glades
- 3,778
- 1
- 12
- 34
0
votes
0 answers
Eclipse C++ Build error: undefined reference to `WSAStartup@8', but program compiles correctly using "-lws2_32" in cmd window
I have a project that perfectly compiles in VS and from command line. However, in Eclipse (C++) I get the following error:
C:\Users\Lukas\AppData\Local\Temp\ccHNeQ9u.o: In function…

user18944383
- 21
- 5
0
votes
0 answers
Socket error 10054 when receiving buffer data - winsock2.h library
I'm new to websocket programming. I have a client and a server running separately, both compiled from C on Windows 7. The server is running fine, with binding, connection and messaging being made successfully. However, what intrigues me is that it…

Leonardo Araujo
- 114
- 8
0
votes
0 answers
What should we notice when one program contains both socket server and client?
I'm using C on Linux.
I write a socket server program which is used to process a client's HTTP requests. When the program receives a specific request, it will connect to another HTTP server, send an HTTP request, receive the response, and then send…

Pudron
- 66
- 1
- 7
0
votes
1 answer
Determining Packets Received with Winsock2
Is there a way to determine how many packets where received while using recv() with Winsock? I am looking for a solution to implement at the client, without special requirements on the server side (which I have no control of)

wnsockbegnr
- 1
- 1
0
votes
4 answers
recv() returns strange buffer C++
I know C++ for quite long, but started using it for my purposes some what a year and a half ago.
I started learning network programming on C++ and the first networking project is "File Transfering between hosts over TCP/IP" which sounds kind easy…
user14089077
0
votes
1 answer
About synchronous access in I/O Works in I/O Completion
Supposing there are 4 I/O workers in the use of I/O Completion Port corresponding to the number of processors, do they need synchronous access on client context among each other?
The client context here refers to what is passed through I/O…

Y.Z
- 626
- 2
- 9
- 21
0
votes
2 answers
Is there a wide character version of WSABUF structure in "Microsoft Visual Studio 8\VC\PlatformSDK\Include\WinSock2"
Is there a wide character version of WSABUF structure in winsock?
I want to write Japanese data on the socket.

Manav Sharma
- 1,053
- 1
- 13
- 21
0
votes
1 answer
Porting to windows sockets
I am trying to port some legacy code and noticed few problems.
I have isolated the code for a simple example. What is wrong with the socket creation code below?
#include
#include
int main()
{
std::cout << "Hello…

Ram
- 3,045
- 3
- 27
- 42
0
votes
0 answers
Will WSASend re-send data?
I'm maintaining some code which use Windows socket to send data to TCP client.
I saw WSASend is only called once. But the wireshark captured data shows 2 duplicate tries was made when time out.
I wonder, does WSASend implement a retry in itself?

Wason
- 1,341
- 1
- 13
- 26