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 » Program didn't exit in Task Manager after click [X]
Re: Program didn't exit in Task Manager after click [X] [message #55406 is a reply to message #55405] Sun, 08 November 2020 13:03 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1135
Registered: August 2007
Senior Contributor
Hello peterh,

Just to clarify TcpSocket behaviour and its relation to Upp::Null:

Upp::TcpSocket uses a "pseudo-blocking" mechanism.
This means, the platform specific, underlying socket is always in non-blocking mode.
This is by design. From the user's POV, this allow us to use the TcpSocket in blocking, non-blocking, or in a time-constrained mode, easily, depending on our specific use-case.

Enter "Null" value.

Upp::Null, as you've noticed, is a Upp-specific value. It is already defined for int, int64, double and bool types (and can be used wtih other types that define a Nuller). So you should make no assumptions about it.

Null / 100000 can semantically be considered an "undefined behaviour", because we are trying to divide something that doesn't exist.

Hence, timeout = Null, means that there is no timeout.


int   foo1 = Null; // Ok
int64 foo2 = (int) Null; // Not OK! This can be considered a user error.
int64 foo3 = Null; // OK.


Null, assigned to timeout (int), in this context, is used to put the TcpSocket in blocking mode. OTOH, "0" (int) is used to put the TcpSocket into non-blocking mode.
timeout > 0 && timeout <= INT_MAX is a time-constraint (in miliseconds) for a given TcpSocket operation.

Best regards,
Oblivion


[Updated on: Sun, 08 November 2020 13:34]

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
Previous Topic: report generator
Next Topic: Pie Chart in U++?
Goto Forum:
  


Current Time: Fri Nov 01 00:47:41 CET 2024

Total time taken to generate the page: 0.01842 seconds