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 » Community » Newbie corner » my TCP client/server don't work correctly
Re: my TCP client/server don't work correctly [message #57050 is a reply to message #57049] Mon, 17 May 2021 23:53 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1094
Registered: August 2007
Senior Contributor
Probleme is, when I connect to the server. Neither my first nor my second data is received by server. Instead I receive a Null string from server (probably when I destroy the client socket) (this behavior can be seen in the console screen)



Then, the reason seems to be:


//	s.Put("time" + '\n'); // << ------------ This won't work... Clang: warning: adding 'char' to a string does not append to the string [-Wstring-plus-int] (not the same thing what SocketClient does. It appends it to a Upp::String, using the relevant operator.)

        s.Put("time\n");            // << ------------ This works as expected.
	s.Put(String("time") + '\n'); // also works
	Cout() << s.GetLine() <<EOL;
	s.Put("hello\n");
	Cout() << s.GetLine() <<EOL;




Best regards,
Oblivion


[Updated on: Tue, 18 May 2021 00:03]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stopping ReadStdIn() function
Next Topic: How to configure for SDL2 project?
Goto Forum:
  


Current Time: Wed May 15 13:41:34 CEST 2024

Total time taken to generate the page: 0.02706 seconds