Home » U++ Library support » U++ MT-multithreading and servers » Problem using TcpSockets
Problem using TcpSockets [message #41919] |
Wed, 05 February 2014 21:02  |
 |
koldo
Messages: 3432 Registered: August 2008
|
Senior Veteran |
|
|
Hello!
I have been playing successfully with sockets based in SocketServer ans SocketClient demos.
However I have had problems with a simple program that sends plain text messages ended with a '\n with:
char *buf = "Message\n";
send(socket, buf, strlen(buf), 0);
Looking to SocketServer demo, it seems that s.Accept(server) blocks the program the second time. I mean:
- 1st s.Accept(server) passes just when demo program begins to send messages
- s.GetLine() works properly
- 2st s.Accept(server) blocks the program
However, if s.GetLine() is called in a loop, it takes all the messages properly.
Is there any kind of protocol embedded in TcpSocket used the way is used in SocketServer/Client demos, that does not match with plain send() calls?
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Wed Apr 30 05:12:56 CEST 2025
Total time taken to generate the page: 0.00958 seconds
|