Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Problem using TcpSockets
Re: Problem using TcpSockets [message #42011 is a reply to message #41919] Mon, 10 February 2014 20:16 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 05 February 2014 15:02

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?




Just to be sure: Do you open a new connection to the server for second 'send'? (the whole testcase would be useful).

Mirek
 
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: Tue May 14 01:08:36 CEST 2024

Total time taken to generate the page: 0.02169 seconds