Added portable app support
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user