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 » How to create sockets that don't block the GUI?
Re: How to create sockets that don't block the GUI? [message #38234 is a reply to message #38231] Fri, 07 December 2012 17:30 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Actually what is being sent is a string of char not a line but it is often referred to as "sending a line".
A String has \0 at the end, NUL terminated.
Note in my previous post I have 'lines' as they were separate lines before adding all the char to the buf to be sent/received.

I have a char buf of 3000
I just add the char and only at the end is there \0

Sometime the only thing sent from the client is "+" which is actually '+' \0 or 43 0 or 0x2B 0x0
The server returns the latitude and longitude of the center in the Java app.

For tracking up to 50 objects with lat, lon, alt, ID, etc then all that data for all 50 is added to the char buf then ended with \0.
On the server the \0 means just that, the end.
So if the buf contains 2000 char and then just + \0 is sent the rest of the buf is ignored and not even sent as \0 means THE END.

A better definition would be a C string.
http://stackoverflow.com/questions/10943033/why-are-strings- in-c-usually-terminated-with-0

(Line feed, '\n', 0x0A, 10 in decimal)
So '\n' is just ch = 10;
When that is sent through a socket that is all it is.
How it is dealt with on receiving can be handled.

NULL is same as '\0' which is same as 0x0 or 0

[Updated on: Fri, 07 December 2012 17:53]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: WebSockets non blocking mode?
Next Topic: SKYLARK js: I offer that we expanded the UxGet function a little with parameter callback
Goto Forum:
  


Current Time: Sun May 05 09:54:33 CEST 2024

Total time taken to generate the page: 0.02771 seconds