U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » Problem using TcpSockets
Problem using TcpSockets [message #41919] Wed, 05 February 2014 21:02 Go to previous message
koldo is currently offline  koldo
Messages: 3461
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GuiMT compilation error on ubuntu12.04
Next Topic: [SOLVED] Unable to compile MT applications (weird assembler error with GCC on Linux i386 arch)
Goto Forum:
  


Current Time: Fri Sep 18 11:42:39 GMT+2 2026

Total time taken to generate the page: 0.00744 seconds