Added portable app support

This commit is contained in:
2026-01-11 17:06:01 -06:00
parent 7dc4ad9b08
commit 2f5271f7c3
13 changed files with 760 additions and 6 deletions

View File

@@ -104,7 +104,12 @@ namespace Tesses::Framework::Streams
}
FileStream::~FileStream()
{
Close();
if(!f) return;
if(this->owns)
{
fclose(this->f);
f=NULL;
}
}
void FileStream::Close()
{

View File

@@ -538,7 +538,10 @@ namespace Tesses::Framework::Streams {
TcpServer::~TcpServer()
{
if(this->valid && this->owns)
Close();
{
NETWORK_CLOSE(this->sock);
}
this->valid=false;
}
void TcpServer::Close()
{
@@ -818,7 +821,9 @@ namespace Tesses::Framework::Streams {
}
NetworkStream::~NetworkStream()
{
Close();
if(this->owns && this->success)
NETWORK_CLOSE(this->sock);
this->success=0;
}
void NetworkStream::SetNoDelay(bool noDelay)
{
@@ -945,5 +950,8 @@ uint16_t TcpServer::GetPort()
{
return 0;
}
bool NetworkStream::DataAvailable(int to){
return false;
}
}
#endif

View File

@@ -126,7 +126,13 @@ namespace Tesses::Framework::Streams {
}
PtyStream::~PtyStream()
{
Close();
if(this->eos) return;
this->eos=true;
#if !defined(GEKKO) && !defined(__APPLE__) && !defined(__PS2__) && !defined(_WIN32) && !defined(__SWITCH__) && !defined(__FreeBSD__) && defined(TESSESFRAMEWORK_ENABLE_PROCESS)
close(this->socket);
kill((pid_t)this->pid,SIGHUP);
#endif
}
void PtyStream::Close()
{