Questions tagged [winsockets]

78 questions
2
votes
2 answers

recv stalls or does not return all data (C code)

I have a web service written in .net on a remote computer with IIS, I am trying to connect to it with a C program using socker to do a SOAP request. My problem is that I have some probem receiving the data: The receiving data loop does not work in a…
Perry
  • 1,113
  • 2
  • 10
  • 22
2
votes
0 answers

Can't compile mongoose after add -lpthread -lws2_32 -fopenmp -lwsock32 using MinGw

I using CLion to write my project,Windows 10 is my OS. I use MinGw to compile the source code with CMAKE, and following the wrong message CMakeFiles\TB2.dir/objects.a(mongoose.c.obj): In function…
黃冠融
  • 21
  • 3
2
votes
1 answer

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…
lowerkey
  • 8,105
  • 17
  • 68
  • 102
2
votes
1 answer

Winsock send recv buffer size

I'm writing a MFC app to implement a client/server scenario and using Win socket for that. I can send/receive a small message e.g. "hello". Also, I tried with buffer of size 1000. However, when I increase its size further, it just hangs. Doesn't…
pree
  • 2,297
  • 6
  • 37
  • 55
2
votes
4 answers

UDP recvfrom thread use too much CPU resources

I am writing a Windows 7 visual c++ server application, which should receive UDP datagrams with 3.6 MB/s. I have a main thread where the recvfrom() receives the data. The socket is a non-blocking socket and has 64kB receive buffer. If no data has…
Tom_K
  • 23
  • 1
  • 3
1
vote
1 answer

Implement a secure connection using SSPI in C++ - clarify some terms

I have to write an application that implements a secure connection between client and server using Microsoft API . Google give me a lot of results, and I have a big mess -need someone to make me some order in my head: Questions: what is SSPI…
RRR
  • 3,937
  • 13
  • 51
  • 75
1
vote
2 answers

GetMem for one PChar variable change content of other PChar variable

So, I have the folowing problem. I have 2 PChar variables. I allocate memory for first, do some operations, allocate memory for the second variable - and on this step the first variable contains bad value (i saw it while debugging). Here is the…
Dmitry Belaventsev
  • 6,347
  • 12
  • 52
  • 75
1
vote
2 answers

Socket transmit data but can't receive response

I am trying to implement UpNP in C++, I found a few sources on google but none worked. I found this one working (http://www.codeproject.com/KB/IP/upnplib.aspx) but it's for .NET, so I decided to sniff the network to see what the code was doing and…
slemdx
  • 1,055
  • 2
  • 16
  • 19
1
vote
3 answers

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…
David
  • 103
  • 2
  • 5
1
vote
1 answer

Using a TCP connection to GET data from a HTTP server, on rare occasion there's garbage data

I'm writing a networked game in C++ using Winsocks 2.2, using Visual Studio 2010, and decided it would be a good idea to use my web-server to store a list of active servers for the game. When a server starts up, it will register itself with my web…
leetNightshade
  • 2,673
  • 2
  • 36
  • 47
1
vote
4 answers

VB6 TCP IP Communication without Doevents or subclassing

What I need to happen with a VB6 application I maintain is the following. Establish a connection to a known address and port over a Ethernet network. Send a request Wait for a response. I tried using WinSock and Winsock replacement but they all…
RS Conley
  • 7,196
  • 1
  • 20
  • 37
1
vote
1 answer

C++ socket error WSAENOTSOCK (10038) after including thread

I created TCP socket connection between client and server. It is necessary for me to use threads because I'm getting x and y coordinates from another process, and drawing those values with OpenGL. Only way I had in mind was to create thread for…
mr. Gauss
  • 601
  • 6
  • 14
1
vote
2 answers

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…
Kristopher Johnson
  • 81,409
  • 55
  • 245
  • 302
1
vote
0 answers

Restarting a UDP socket to accept DTLS connection not working

I am starting a UDP Server and then accepting a DTLS connection to read incoming data. The code is working fine. But once I reuse the connection from the client by restarting the client socket Server is unable to read anything. Using Cyassl library…
Shantanu
  • 27
  • 6
1
vote
1 answer

Windows TCP Socket Timeout C++

I have a question How to know if a client didn't respond to the server during a specified time ?! I am using threading not select function. your help will be greatly appreciated :) Thank you.
Rehab Reda
  • 193
  • 7
  • 16