Questions tagged [winsockets]

78 questions
0
votes
1 answer

C++ client fails to send to server / Winsock

I 'm working on an advanced client-server program, where I send the codes of a joypad (buttons that have been pressed) to a server. Since I send more than one joypad codes, in one passage of my C++ code, I have to repeat the client code segment. I…
dempap
  • 352
  • 1
  • 9
  • 21
0
votes
1 answer

C++ server unable to receive data from client / Winsock

I am working on a simple client-server application. However, after client runs, i get the message error 10038 with the recv(), in the server side. The socket number descriptor retains the same value in both client and server, thus i think there is…
dempap
  • 352
  • 1
  • 9
  • 21
0
votes
1 answer

High CPU usage of threads reading synchronously from yet to be filled resources

(Working on win32/c++ environment) I have a function that calls ReadFile (synchronously) with a fixed size of one byte to read from a SOCKET resource (of WINSOCK). There's multiple threads running this function. The data is written to sockets…
0
votes
2 answers

Is there a way to force windows to produce short reads/writes on socket calls?

this is for debugging purposes. To test that short send/short recv handling part of the code is working... Is there a way to force Windows to produce short send/rcvs even for small number of bytes to be read/written from/to socket? I prefer to do…
NoSenseEtAl
  • 28,205
  • 28
  • 128
  • 277
0
votes
4 answers

Why is my c++ Winsock server unable to receive data from the client?

I tried to run a simple client and server program. Therin, I tried to send the server a message from the client and have the server echo that message back. The problem is that every time I do I get a 10057 error. I have no idea why. Here is the…
Mad Del
  • 1
  • 1
0
votes
1 answer

Limiting the connections per ip with winsock

How do you limit connections per IP with winsock? Lets say I wanted to limit them to 20 connections per IP then don't accept the connection once its reach the limit. I can't think of the logic on doing this. I've thought of using callbacks on…
zikdaljin
  • 95
  • 2
  • 5
  • 14
0
votes
1 answer

Creating winsock client through MFC doc/view architecture

I have a game TicTacToe which was created in MFC with document/view architecture and I have server (standart console application) witn winsockets. Where I should initialize socket in client to connect it with server? (It must be exactly winsock,…
yarpoplar
  • 71
  • 8
0
votes
3 answers

How to simulate a client server application I wrote in c++ using windows sockets?

I was asked recently to write a client server application so I did this using c++ and windows sockets and I tried it on two pcs on a LAN and it worked pretty well.My professor wants to see this working for real but I thought there could be a way to…
0
votes
1 answer

FD_SIZE and Maximum Number of Sockets an Application Can use in Windows

I am using a streaming server on windows which is hitting the 32 stream limit. Based on following article on msdn http://support.microsoft.com/kb/111855 we found out that reason is FD_SET size which is defaulted to 64 in winsock. After increasing…
MarvinDev
  • 43
  • 6
0
votes
2 answers

winsock application and multhreading - listening to socket event from another thread

assume we have an application which uses winsock to implement tcp communication. for each socket we create a thread and block-receiving on it. when data arrives, we would like to notify other threads (listening threads). i was wondering what is the…
roybj
  • 278
  • 3
  • 14
0
votes
1 answer

c++ builder TClientWinSocket simbol substitution

I have the following problem. I have to send a text telegram over tcp/ip to a host device. Telegram should be terminated using 0x1A (CTRL-Z) character. But when I send it, host told me that there is a wrong symbol in the telegram. When I terminate a…
Vlad
  • 96
  • 8
0
votes
1 answer

Winsocket Timeout for send operation

I have written a TCP Socket application in vc++ 2008. I want 'send' operation to be timed out if it takes more than x seconds. For that I tried using char *optValue = "5000"; setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, optValue,…
Pavan
  • 1,023
  • 2
  • 12
  • 25
0
votes
2 answers

WinSock Error 10061

I have written a simple client/server application using winsock. The server and client connect and communicate over TCP port 76567 (just a random number I chose) on the localhost. I've tested it on three desktops, two running XP and the other…
StackTrace
  • 41
  • 1
  • 2
  • 3
-1
votes
2 answers

C program that connects to index.php on xampp server

I am looking to setup a C client that can communicate with an index.php file running on a local XAMPP server. All the tutorials online are based on creating a C client and connecting to a C server. But how would I connect a C client to a PHP file on…
-1
votes
1 answer

Why this WinSock code is not connecting to client?

I am new to Winsock programming and came across this code while reading the book "Network Programming For Microsoft Windows " . But it seems that this code is not able to connect to the client. Please tell me how can I fix this problem . My Server…
Saksham
  • 197
  • 3
  • 11