void tcpConnectionClose(TcpConnection tcpConnection){ TcpConnectionInternal* internal=(TcpConnectionInternal*)tcpConnection; close(internal->sockfd); internal->active=FALSE; environmentThreadLock(internal->thread); environmentThreadNotify(internal->thread); environmentThreadUnlock(internal->thread); }
void tcpConnectionPushCommand(TcpConnection tcpConnection,Command command){ TcpConnectionInternal* internal=(TcpConnectionInternal*)tcpConnection; if(internal->active==TRUE){ environmentThreadLock(internal->thread); arrayListAddLast(internal->commands,command); environmentThreadNotify(internal->thread); environmentThreadUnlock(internal->thread); } }