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   |
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
|
|
|
 |
|
How to create sockets that don't block the GUI?
By: lectus on Fri, 07 December 2012 13:38
|
 |
|
Re: How to create sockets that don't block the GUI?
By: Zbych on Fri, 07 December 2012 13:48
|
 |
|
Re: How to create sockets that don't block the GUI?
By: lectus on Fri, 07 December 2012 13:53
|
 |
|
Re: How to create sockets that don't block the GUI?
By: Zbych on Fri, 07 December 2012 14:06
|
 |
|
Re: How to create sockets that don't block the GUI?
By: lectus on Fri, 07 December 2012 14:06
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: lectus on Fri, 07 December 2012 16:00
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: lectus on Fri, 07 December 2012 19:28
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: jlh67 on Mon, 17 February 2014 09:51
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: jlh67 on Mon, 17 February 2014 17:52
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: jlh67 on Tue, 18 February 2014 21:19
|
 |
|
Re: How to create sockets that don't block the GUI?
|
 |
|
Re: How to create sockets that don't block the GUI?
By: jlh67 on Wed, 19 February 2014 18:07
|
 |
|
Re: How to create sockets that don't block the GUI?
By: MrSarup on Tue, 20 December 2016 13:02
|
Goto Forum:
Current Time: Tue Apr 29 14:10:36 CEST 2025
Total time taken to generate the page: 0.03487 seconds
|