FACT++  1.0
int tcpip_open_connection ( int  conn_id,
int  path 
)

Definition at line 1332 of file tcpip.c.

References NET_CONNECTION::channel, closesock, Net_conns, NET_CONNECTION::node, NET_CONNECTION::port, Read_buffer_size, NET_CONNECTION::reading, NET_CONNECTION::task, NET_CONNECTION::timr_ent, Write_buffer_size, and NET_CONNECTION::write_timedout.

Referenced by ast_conn_h().

1333 {
1334  /* Fill in/clear some fields, the node and task field
1335  * get filled in later by a special packet.
1336  */
1337  int val, ret_code;
1338 
1339 
1340  val = 1;
1341  if ((ret_code = setsockopt(path, IPPROTO_TCP, TCP_NODELAY,
1342  (char*)&val, sizeof(val))) == -1 )
1343  {
1344 #ifdef DEBUG
1345  printf("Couln't set TCP_NODELAY\n");
1346 #endif
1347  closesock(path);
1348  return(0);
1349  }
1350  val = Write_buffer_size;
1351  if ((ret_code = setsockopt(path, SOL_SOCKET, SO_SNDBUF,
1352  (char*)&val, sizeof(val))) == -1 )
1353  {
1354 #ifdef DEBUG
1355  printf("Couln't set SO_SNDBUF\n");
1356 #endif
1357  closesock(path);
1358  return(0);
1359  }
1360 
1361  val = Read_buffer_size;
1362  if ((ret_code = setsockopt(path, SOL_SOCKET, SO_RCVBUF,
1363  (char*)&val, sizeof(val))) == -1 )
1364  {
1365 #ifdef DEBUG
1366  printf("Couln't set SO_RCVBUF\n");
1367 #endif
1368  closesock(path);
1369  return(0);
1370  }
1371 
1372  Net_conns[conn_id].channel = path;
1373  Net_conns[conn_id].node[0] = 0;
1374  Net_conns[conn_id].task[0] = 0;
1375  Net_conns[conn_id].port = 0;
1376  Net_conns[conn_id].reading = -1;
1377  Net_conns[conn_id].timr_ent = NULL;
1378  Net_conns[conn_id].write_timedout = 0;
1379  return(1);
1380 }
TIMR_ENT * timr_ent
Definition: dim.h:413
char task[MAX_TASK_NAME]
Definition: dim.h:408
DllExp DIM_NOSHARE NET_CONNECTION * Net_conns
Definition: conn_handler.c:32
char node[MAX_NODE_NAME]
Definition: dim.h:407
int channel
Definition: dim.h:398
int port
Definition: dim.h:409
#define closesock(s)
Definition: tcpip.c:36
static int Write_buffer_size
Definition: tcpip.c:107
static int Read_buffer_size
Definition: tcpip.c:108
int write_timedout
Definition: dim.h:412
int reading
Definition: dim.h:410

+ Here is the caller graph for this function: