コード例 #1
0
ファイル: tcpconnection.c プロジェクト: gidish/PlanckDB
void tcpConnectionClose(TcpConnection tcpConnection){
	TcpConnectionInternal* internal=(TcpConnectionInternal*)tcpConnection;
	close(internal->sockfd);
	internal->active=FALSE;
        environmentThreadLock(internal->thread);
        environmentThreadNotify(internal->thread);
        environmentThreadUnlock(internal->thread);
}
コード例 #2
0
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);
        }
}