Lines Matching defs:cr_tcpip

195 cr_tcpip_data cr_tcpip;
518 cr_tcpip.server_sock = CreateListeningSocket(port);
529 conn->tcp_socket = accept( cr_tcpip.server_sock, (struct sockaddr *) &addr, &addr_length );
597 crLockMutex(&cr_tcpip.mutex);
600 buf = (CRTCPIPBuffer *) crBufferPoolPop( cr_tcpip.bufpool, conn->buffer_size );
605 cr_tcpip.bufpool,
616 crUnlockMutex(&cr_tcpip.mutex);
671 crLockMutex(&cr_tcpip.mutex);
673 crBufferPoolPush(cr_tcpip.bufpool, tcpip_buffer, tcpip_buffer->allocated);
675 crUnlockMutex(&cr_tcpip.mutex);
747 crLockMutex(&cr_tcpip.mutex);
749 if (cr_tcpip.bufpool) {
753 crBufferPoolPush( cr_tcpip.bufpool, tcpip_buffer, tcpip_buffer->allocated );
756 crUnlockMutex(&cr_tcpip.mutex);
927 crNetDispatchMessage( cr_tcpip.recv_list, conn, msg, len );
952 const int num_conns = cr_tcpip.num_conns;
961 crLockMutex(&cr_tcpip.recvmutex);
972 CRConnection *conn = cr_tcpip.conns[i];
1067 crUnlockMutex(&cr_tcpip.recvmutex);
1076 crUnlockMutex(&cr_tcpip.recvmutex);
1091 crUnlockMutex(&cr_tcpip.recvmutex);
1102 CRConnection *conn = cr_tcpip.conns[i];
1123 crUnlockMutex(&cr_tcpip.recvmutex);
1141 crNetDispatchMessage( cr_tcpip.recv_list, conn, msg, len );
1158 cr_tcpip.recv_list = rfl;
1159 cr_tcpip.close_list = cfl;
1160 if ( cr_tcpip.initialized )
1165 cr_tcpip.initialized = 1;
1167 cr_tcpip.num_conns = 0;
1168 cr_tcpip.conns = NULL;
1170 cr_tcpip.server_sock = -1;
1173 crInitMutex(&cr_tcpip.mutex);
1174 crInitMutex(&cr_tcpip.recvmutex);
1176 cr_tcpip.bufpool = crBufferPoolInit(16);
1198 cr_tcpip.conns[conn->index] = NULL; /* remove from table */
1214 cr_tcpip.conns[conn->index] = NULL; /* remove from table */
1238 cr_tcpip.conns[conn->index] = NULL; /* remove from table */
1333 cr_tcpip.conns[conn->index] = NULL; /* remove from table */
1344 int num_conns = cr_tcpip.num_conns;
1366 cr_tcpip.conns[conn->index] = NULL;
1371 if ( cr_tcpip.conns[i] && cr_tcpip.conns[i]->type != CR_NO_CONNECTION )
1378 if (none_left && cr_tcpip.server_sock != -1)
1381 crCloseSocket( cr_tcpip.server_sock );
1382 cr_tcpip.server_sock = -1;
1384 crFreeMutex(&cr_tcpip.mutex);
1385 crFreeMutex(&cr_tcpip.recvmutex);
1387 crBufferPoolFree( cr_tcpip.bufpool );
1388 cr_tcpip.bufpool = NULL;
1390 cr_tcpip.initialized = 0;
1406 CRASSERT( cr_tcpip.initialized );
1420 conn->index = cr_tcpip.num_conns;
1427 for (i = 0; i < cr_tcpip.num_conns; i++) {
1428 if (cr_tcpip.conns[i] == NULL) {
1430 cr_tcpip.conns[i] = conn;
1438 n_bytes = ( cr_tcpip.num_conns + 1 ) * sizeof(*cr_tcpip.conns);
1439 crRealloc( (void **) &cr_tcpip.conns, n_bytes );
1440 cr_tcpip.conns[cr_tcpip.num_conns++] = conn;
1464 *num = cr_tcpip.num_conns;
1466 return cr_tcpip.conns;