rototalk.h File Reference

#include <stdint.h>

Go to the source code of this file.

Enumerations

enum  RotoTalkErr {
  rototalk_success = 0, rototalk_err_whoami, rototalk_err_alreadyconn, rototalk_err_unknownhost,
  rototalk_err_notinethost, rototalk_err_socketfail, rototalk_err_connectfail, rototalk_err_notconnected,
  rototalk_err_illegalmethod, rototalk_err_badsender, rototalk_err_badsendcmd, rototalk_err_badsendsize,
  rototalk_err_badsenddata, rototalk_err_badrecvack, rototalk_err_badrecvacksize, rototalk_err_badrecvackdata,
  rototalk_err_badrecvstate, rototalk_err_nack, rototalk_err_reallocate, rototalk_err_badconfig,
  rototalk_last_of_errors
}

Functions

int32_t roto_open_DCP_connection (const char *host)
int32_t roto_open_DCS_connection (const char *host)
int32_t roto_open_BeamMon_connection (const char *host)
int32_t roto_open_connection (const char *host, int32_t port, int32_t whoami)
int32_t roto_set_connection_nodelay (int32_t val)
int32_t roto_close_connection ()
int32_t roto_open_daqfile (int32_t detector, int32_t run, int32_t subrun)
int32_t roto_close_daqfile (int32_t detector, int32_t run, int32_t subrun)
int32_t roto_open_dcsfile (int32_t detector, int32_t sec, int32_t nanosec)
int32_t roto_close_dcsfile ()
int32_t roto_open_beammonfile (int32_t sec, int32_t nanosec)
int32_t roto_close_beammonfile ()
int32_t roto_send_record (const void *buffer, int32_t nbytes)
int32_t roto_send_autosave_config (const char *stream, uint32_t nrec, uint32_t nsec)
int32_t roto_send_compress_config (const char *stream, int32_t level)
int32_t roto_send_basketsize_config (const char *stream, int32_t basketsize)
int32_t roto_request_shutdown (int32_t priority)
int32_t roto_open_named_file (const char *fname)
int32_t roto_close_named_file (const char *fname)

Variables

int32_t roto_verbose

Enumeration Type Documentation

Enumerator:
rototalk_success 
rototalk_err_whoami 
rototalk_err_alreadyconn 
rototalk_err_unknownhost 
rototalk_err_notinethost 
rototalk_err_socketfail 
rototalk_err_connectfail 
rototalk_err_notconnected 
rototalk_err_illegalmethod 
rototalk_err_badsender 
rototalk_err_badsendcmd 
rototalk_err_badsendsize 
rototalk_err_badsenddata 
rototalk_err_badrecvack 
rototalk_err_badrecvacksize 
rototalk_err_badrecvackdata 
rototalk_err_badrecvstate 
rototalk_err_nack 
rototalk_err_reallocate 
rototalk_err_badconfig 
rototalk_last_of_errors 

Definition at line 60 of file rototalk.h.


Function Documentation

int32_t roto_close_beammonfile (  ) 
int32_t roto_close_connection (  ) 

Definition at line 401 of file rototalk.c.

References roto_conn::conn_host, roto_conn::conn_nrec_sent, roto_conn::conn_port, roto_conn::conn_socketfd, g_roto_conn, iam, logError(), logInfo(), roto_complete_cmd(), roto_disconn, roto_recv_cmdreply(), roto_send_command(), roto_verbose, and rototalk_err_notconnected.

Referenced by BeamData::close_connection(), RotoClient::CloseConnection(), and main().

00402 {
00403    rotocmd  cmd;
00404    int32_t      err;
00405 
00406    /*
00407     * complain if we aren't actually connected
00408     */
00409    if (g_roto_conn.conn_socketfd<0) {
00410       logError("roto_close_connection: not connected");
00411       return rototalk_err_notconnected;
00412    }
00413 
00414    /*
00415     * Send "command" in fashion similar to run control protocol
00416     */
00417    cmd = roto_complete_cmd(roto_disconn,iam);
00418    err = roto_send_command(cmd,0,0);
00419    if (err) return err;
00420    /*
00421     * Get the command reply (ACK|NACK + state report)
00422     */
00423    err = roto_recv_cmdreply(cmd);
00424 
00425    /* vicious (cf. man -S 2 shutdown) without regard to further send/receives
00426    shutdown(conn_socket,2)
00427    */
00428 
00429    /*
00430     * friendly closing of the socket
00431     */
00432    errno = 0;
00433    while ( close(g_roto_conn.conn_socketfd) == -1 && 
00434                                       errno == EINTR ) errno = 0;
00435 
00436    /*
00437     * make a note that we're not connected
00438     */
00439    g_roto_conn.conn_socketfd  = -1;
00440    strcpy(g_roto_conn.conn_host,"no-longer-connected");
00441    g_roto_conn.conn_port      = 0;
00442    g_roto_conn.conn_nrec_sent = 0;
00443 
00444    if (roto_verbose>0)
00445       logInfo("roto_close_connection requested");
00446 
00447    return err;
00448 }

int32_t roto_close_daqfile ( int32_t  detector,
int32_t  run,
int32_t  subrun 
)

Definition at line 674 of file rototalk.c.

References MINOS_ROOTER_DCP, roto_closef, and roto_set_std_file_status().

Referenced by RotoClient::CloseDAQFile().

00675 {
00676    return roto_set_std_file_status(roto_closef,MINOS_ROOTER_DCP,
00677                                    detector,run,subrun);
00678 }

int32_t roto_close_dcsfile (  ) 

Definition at line 751 of file rototalk.c.

References roto_dcsfile::detector, g_roto_dcsfile, MINOS_ROOTER_DCS, roto_dcsfile::nsec, roto_closef, roto_set_std_file_status(), and roto_dcsfile::sec.

Referenced by RotoClient::CloseDCSFile(), roto_open_dcsfile(), and send_bogus_stuff().

00752 {
00753    int32_t err;
00754    err = roto_set_std_file_status(roto_closef,MINOS_ROOTER_DCS,
00755                                   g_roto_dcsfile.detector,
00756                                   g_roto_dcsfile.sec,
00757                                   g_roto_dcsfile.nsec);
00758 
00759    if (!err) {
00760       g_roto_dcsfile.detector = 0;
00761       g_roto_dcsfile.sec      = 0;
00762       g_roto_dcsfile.nsec     = 0;
00763    }
00764    return err;
00765 }

int32_t roto_close_named_file ( const char *  fname  ) 

Definition at line 883 of file rototalk.c.

References roto_closef, and roto_set_named_file_status().

Referenced by RotoClient::CloseFile(), and send_whole_file().

00884 {
00885    return roto_set_named_file_status(roto_closef,fname);
00886 }

int32_t roto_open_BeamMon_connection ( const char *  host  ) 

Definition at line 203 of file rototalk.c.

References MINOS_ROOTER_BEAMMON, ROOTER_PORT_BEAMMON, and roto_open_connection().

Referenced by main(), and BeamData::open_connection().

int32_t roto_open_beammonfile ( int32_t  sec,
int32_t  nanosec 
)

Definition at line 785 of file rototalk.c.

References g_roto_beammonfile, logError(), MINOS_ROOTER_BEAMMON, roto_beammonfile::nsec, roto_close_beammonfile(), roto_openf, roto_set_std_file_status(), rototalk_success, and roto_beammonfile::sec.

Referenced by RotoClient::OpenBeamMonFile(), and send_bogus_stuff().

00786 {
00787    int32_t err;
00788 
00789    if (g_roto_beammonfile.sec  != 0 || 
00790        g_roto_beammonfile.nsec != 0    ) {
00791       /* a file is already open */
00792 
00793       if (g_roto_beammonfile.sec  == sec  || 
00794           g_roto_beammonfile.nsec == nsec    ) {
00795          /* do nothing, requested the same file ... */
00796          return rototalk_success;
00797       }
00798 
00799       /* a different file is already open! */
00800       logError("roto_open_beammonfile:");
00801       logError(" a file (0x%8.8x 0x%8.8x) is already open",
00802                g_roto_beammonfile.sec,g_roto_beammonfile.nsec);
00803       logError(" close it and open (0x%8.8x 0x%8.8x)",
00804                sec,nsec);
00805       roto_close_beammonfile();
00806    }
00807 
00808 
00809    err = roto_set_std_file_status(roto_openf,MINOS_ROOTER_BEAMMON,
00810                                   0,sec,nsec);
00811    if (!err) {
00812       g_roto_beammonfile.sec  = sec;
00813       g_roto_beammonfile.nsec = nsec;
00814    }
00815 
00816    return err;
00817 }

int32_t roto_open_connection ( const char *  host,
int32_t  port,
int32_t  whoami 
)

Definition at line 224 of file rototalk.c.

References roto_conn::conn_host, roto_conn::conn_nrec_sent, roto_conn::conn_port, roto_conn::conn_socketfd, err(), g_roto_conn, iam, logDebug(), logError(), logInfo(), logWarn(), MINOS_ROOTER_BEAMMON, MINOS_ROOTER_DCP, MINOS_ROOTER_DCS, roto_complete_cmd(), roto_connect, roto_recv_cmdreply(), roto_send_command(), roto_set_connection_nodelay(), roto_verbose, rototalk_err_alreadyconn, rototalk_err_connectfail, rototalk_err_notinethost, rototalk_err_socketfail, rototalk_err_unknownhost, and rototalk_err_whoami.

Referenced by main(), roto_open_BeamMon_connection(), roto_open_DCP_connection(), roto_open_DCS_connection(), and RotoClient::SetupConnection().

00225 {
00226    const  char        *whoami_name = "unknown";
00227    int32_t                 socketfd = 0;
00228    struct hostent     *host_ptr;
00229    struct sockaddr_in  serv_addr;
00230    uint32_t   addr; /* good for 4 byte address */
00231    struct in_addr      ad;
00232 
00233    int32_t                 err;
00234    rotocmd             cmd;
00235 
00236    switch (whoami) {
00237    case MINOS_ROOTER_DCP:     whoami_name = "DCP";     break;
00238    case MINOS_ROOTER_DCS:     whoami_name = "DCS";     break;
00239    case MINOS_ROOTER_BEAMMON: whoami_name = "BeamMon"; break;
00240    default:
00241       logError("roto_open_connection: whoami 0x%02x is not allowed",whoami);
00242       return rototalk_err_whoami;
00243    }
00244    iam = whoami;
00245 
00246    if (g_roto_conn.conn_socketfd>0) {
00247       logError("roto_open_connection: already established to %s:%d",
00248                g_roto_conn.conn_host,g_roto_conn.conn_port);
00249 
00250       /* 
00251        * should we close that connection and reopen 
00252        * or simply return a failure??
00253        * ... for now simply leave existing one open
00254        */
00255       return rototalk_err_alreadyconn;
00256    }
00257 
00258    /*
00259     * code based on both: 
00260     *   Unix Network Programming, W. Richard Stevens, Prentice Hall, pg 286
00261     *   ROOT TSocket and TUnixSystem classes
00262     */
00263 
00264    /*
00265     * prepare the address structure
00266     */
00267 
00268    memset(&serv_addr,0,sizeof(serv_addr)); /* clear the structure */
00269 #ifdef HASNOT_INETATON
00270    logWarn("roto_open_connection: using obsolete inet_addr() function");
00271 
00272    if ((addr = (uint32_t)inet_addr(host)) 
00273                                                    != INADDR_NONE) {
00274 #else
00275    if (inet_aton(host, &ad)) {
00276       memcpy(&addr, &ad.s_addr, sizeof(ad.s_addr));
00277 #endif
00278       if (!(host_ptr = gethostbyaddr((const char *)&addr,
00279                                      sizeof(addr), AF_INET))) {
00280          /* unnamed host */
00281       }
00282    }
00283    else if ((host_ptr = gethostbyname(host))) {
00284      logDebug(3,"roto_open_connection: resorted to gethostbyname"); 
00285    } 
00286    if (!host_ptr) {
00287       logError("roto_open_connection: unknown host %s",host);
00288       return rototalk_err_unknownhost;
00289    }
00290    if (host_ptr->h_addrtype != AF_INET) {
00291       logError("roto_open_connection: %s not an internet host",host);
00292       return rototalk_err_notinethost;
00293    }
00294 
00295    /*
00296     * Magic incantation
00297     */
00298    memcpy(&addr,host_ptr->h_addr,host_ptr->h_length);
00299    serv_addr.sin_family      = AF_INET;
00300    serv_addr.sin_addr.s_addr = addr;
00301    serv_addr.sin_port        = htons(port);
00302 
00303    /*
00304     * Open the TCP socket (an Internet stream socket)
00305     */
00306    if ( (socketfd = socket(AF_INET,SOCK_STREAM, 0)) < 0 ) {
00307       logError("roto_open_connection: failed to open socket");
00308       return rototalk_err_socketfail;
00309    }
00310 
00311    /*
00312     * Connect to the server
00313     */
00314    if (connect(socketfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) {
00315       logError("roto_open_connection: can't connect");
00316       logError("  host '%s' expanded '%s' port %d",host,host_ptr->h_name,port);
00317       logError("  sin_addr.s_addr 0x%8.8x sin_port 0x%4.4x",
00318                serv_addr.sin_addr.s_addr,serv_addr.sin_port);
00319       return rototalk_err_connectfail;
00320    }
00321 
00322    /* 
00323     * Save a copy of who we're connected to
00324     */
00325    g_roto_conn.conn_socketfd  = socketfd;
00326    strcpy(g_roto_conn.conn_host,host_ptr->h_name); /* copy the expanded name */
00327    g_roto_conn.conn_port      = port;
00328    g_roto_conn.conn_nrec_sent = 0;
00329 
00330    /*
00331     * by default make connection use TCP_NODELAY
00332     */
00333    roto_set_connection_nodelay(1);
00334 
00335    if (roto_verbose>0) {      
00336       logInfo("roto_open_connection: %s:%d, i am '%s'",
00337               host,port,whoami_name);
00338    }
00339    
00340    /*
00341     * Send "command" in fashion similar to run control protocol
00342     */
00343    cmd = roto_complete_cmd(roto_connect,iam);
00344    err = roto_send_command(cmd,0,0);
00345    if (err) return err;
00346    /*
00347     * Get the command reply (ACK|NACK + state report)
00348     */
00349    return roto_recv_cmdreply(cmd);
00350 }

int32_t roto_open_daqfile ( int32_t  detector,
int32_t  run,
int32_t  subrun 
)

Definition at line 653 of file rototalk.c.

References MINOS_ROOTER_DCP, roto_openf, and roto_set_std_file_status().

Referenced by RotoClient::OpenDAQFile().

00654 {
00655    return roto_set_std_file_status(roto_openf,MINOS_ROOTER_DCP,
00656                                    detector,run,subrun);
00657 }

int32_t roto_open_DCP_connection ( const char *  host  ) 

Definition at line 195 of file rototalk.c.

References MINOS_ROOTER_DCP, ROOTER_PORT_DAQ, and roto_open_connection().

Referenced by main().

00196 {
00197    return roto_open_connection(host,ROOTER_PORT_DAQ,MINOS_ROOTER_DCP);
00198 }

int32_t roto_open_DCS_connection ( const char *  host  ) 

Definition at line 199 of file rototalk.c.

References MINOS_ROOTER_DCS, ROOTER_PORT_DCS, and roto_open_connection().

Referenced by main().

00200 {
00201    return roto_open_connection(host,ROOTER_PORT_DCS,MINOS_ROOTER_DCS);
00202 }

int32_t roto_open_dcsfile ( int32_t  detector,
int32_t  sec,
int32_t  nanosec 
)

Definition at line 698 of file rototalk.c.

References roto_dcsfile::detector, g_roto_dcsfile, logError(), MINOS_ROOTER_DCS, roto_dcsfile::nsec, roto_close_dcsfile(), roto_openf, roto_set_std_file_status(), rototalk_success, and roto_dcsfile::sec.

Referenced by RotoClient::OpenDCSFile(), and send_bogus_stuff().

00699 {
00700    int32_t err;
00701 
00702    if (g_roto_dcsfile.detector != 0 ||
00703        g_roto_dcsfile.sec      != 0 || 
00704        g_roto_dcsfile.nsec     != 0    ) {
00705       /* a file is already open */
00706 
00707       if (g_roto_dcsfile.detector == detector ||
00708           g_roto_dcsfile.sec      == sec      || 
00709           g_roto_dcsfile.nsec     == nsec        ) {
00710          /* do nothing, requested the same file ... */
00711          return rototalk_success;
00712       }
00713 
00714       /* a different file is already open! */
00715       logError("roto_open_dcsfile:");
00716       logError(" a file (0x%2.2x 0x%8.8x 0x%8.8x) is already open",
00717                g_roto_dcsfile.detector,g_roto_dcsfile.sec,g_roto_dcsfile.nsec);
00718       logError(" close it and open (0x%2.2x 0x%8.8x 0x%8.8x)",
00719                detector,sec,nsec);
00720       roto_close_dcsfile();
00721    }
00722 
00723    err = roto_set_std_file_status(roto_openf,MINOS_ROOTER_DCS,
00724                                   detector,sec,nsec);
00725    if (!err) {
00726       g_roto_dcsfile.detector = detector;
00727       g_roto_dcsfile.sec      = sec;
00728       g_roto_dcsfile.nsec     = nsec;
00729    }
00730 
00731    return err;
00732 }

int32_t roto_open_named_file ( const char *  fname  ) 

Definition at line 864 of file rototalk.c.

References roto_openf, and roto_set_named_file_status().

Referenced by RotoClient::OpenFile(), and send_whole_file().

00865 {
00866    return roto_set_named_file_status(roto_openf,fname);
00867 }

int32_t roto_request_shutdown ( int32_t  priority  ) 

Definition at line 1219 of file rototalk.c.

References roto_conn::conn_socketfd, g_roto_conn, iam, logError(), logNotice(), roto_complete_cmd(), roto_recv_cmdreply(), roto_send_command(), roto_shutdown, roto_verbose, and rototalk_err_notconnected.

Referenced by main(), and RotoClient::SendShutdownMessage().

01220 {
01221    rotocmd cmd;
01222    int32_t     err;
01223 
01224    if (g_roto_conn.conn_socketfd<0) {
01225       logError("roto_request_shutdown: not connected");
01226       return rototalk_err_notconnected;
01227    }
01228 
01229    /*
01230     * Send "command" in fashion similar to run control protocol
01231     */
01232    cmd = roto_complete_cmd(roto_shutdown,iam);
01233    err = roto_send_command(cmd,&priority,sizeof(int32_t));
01234    if (err) return err;
01235 
01236    if (roto_verbose>0)
01237       logNotice("roto_request_shutdown (priority=%d)",priority);
01238 
01239    /*
01240     * Get the command reply (ACK|NACK + state report)
01241     */
01242    return roto_recv_cmdreply(cmd);
01243 
01244 }

int32_t roto_send_autosave_config ( const char *  stream,
uint32_t  nrec,
uint32_t  nsec 
)

Definition at line 510 of file rototalk.c.

References roto_conn::conn_socketfd, g_roto_conn, iam, logDebug(), logError(), roto_complete_cmd(), roto_config, roto_recv_cmdreply(), roto_send_command(), roto_verbose, and rototalk_err_notconnected.

Referenced by config_autosave().

00511 {
00512    rotocmd cmd;
00513    int32_t     err;
00514    char    minibuffer[4096];
00515 
00516    if (g_roto_conn.conn_socketfd<0) {
00517       logError("roto_send_autosave_config: not connected");
00518       return rototalk_err_notconnected;
00519    }
00520 
00521    if (roto_verbose>1) 
00522       logDebug(2,"roto_send_autosave_config: stream \"%s\" - %d rec, %d sec",
00523              stream,nrec,nsec);
00524 
00525    /* format the config */
00526    sprintf(minibuffer,"config autosave: %s = %d rec %d sec",stream,nrec,nsec);
00527 
00528    /*
00529     * Send "command" in fashion similar to run control protocol
00530     */
00531    cmd = roto_complete_cmd(roto_config,iam);
00532    err = roto_send_command(cmd,minibuffer,strlen(minibuffer));
00533    if (err) return err;
00534    /*
00535     * Get the command reply (ACK|NACK + state report)
00536     */
00537    return roto_recv_cmdreply(cmd);
00538 }

int32_t roto_send_basketsize_config ( const char *  stream,
int32_t  basketsize 
)

Definition at line 604 of file rototalk.c.

References roto_conn::conn_socketfd, g_roto_conn, iam, logDebug(), logError(), roto_complete_cmd(), roto_config, roto_recv_cmdreply(), roto_send_command(), roto_verbose, and rototalk_err_notconnected.

Referenced by config_basketsize().

00605 {
00606    rotocmd cmd;
00607    int32_t     err;
00608    char    minibuffer[4096];
00609 
00610    if (g_roto_conn.conn_socketfd<0) {
00611       logError("roto_send_basketsize_config: not connected");
00612       return rototalk_err_notconnected;
00613    }
00614 
00615    if (roto_verbose>1) 
00616       logDebug(2,"roto_send_basketsize_config: stream \"%s\" - basketsize %d",
00617                stream,bsize);
00618 
00619    /* format the config */
00620    sprintf(minibuffer,"config basketsize: %s = %d ",stream,bsize);
00621 
00622    /*
00623     * Send "command" in fashion similar to run control protocol
00624     */
00625    cmd = roto_complete_cmd(roto_config,iam);
00626    err = roto_send_command(cmd,minibuffer,strlen(minibuffer));
00627    if (err) return err;
00628    /*
00629     * Get the command reply (ACK|NACK + state report)
00630     */
00631    return roto_recv_cmdreply(cmd);
00632 }

int32_t roto_send_compress_config ( const char *  stream,
int32_t  level 
)

Definition at line 559 of file rototalk.c.

References roto_conn::conn_socketfd, g_roto_conn, iam, logDebug(), logError(), roto_complete_cmd(), roto_config, roto_recv_cmdreply(), roto_send_command(), roto_verbose, and rototalk_err_notconnected.

Referenced by config_compress().

00560 {
00561    rotocmd cmd;
00562    int32_t     err;
00563    char    minibuffer[4096];
00564 
00565    if (g_roto_conn.conn_socketfd<0) {
00566       logError("roto_send_compress_config: not connected");
00567       return rototalk_err_notconnected;
00568    }
00569 
00570    if (roto_verbose>1) 
00571       logDebug(2,"roto_send_compress_config: stream \"%s\" - compress %d",
00572                stream,level);
00573 
00574    /* format the config */
00575    sprintf(minibuffer,"config compress: %s = %d ",stream,level);
00576 
00577    /*
00578     * Send "command" in fashion similar to run control protocol
00579     */
00580    cmd = roto_complete_cmd(roto_config,iam);
00581    err = roto_send_command(cmd,minibuffer,strlen(minibuffer));
00582    if (err) return err;
00583    /*
00584     * Get the command reply (ACK|NACK + state report)
00585     */
00586    return roto_recv_cmdreply(cmd);
00587 }

int32_t roto_send_record ( const void *  buffer,
int32_t  nbytes 
)

Definition at line 465 of file rototalk.c.

References roto_conn::conn_nrec_sent, roto_conn::conn_socketfd, g_roto_conn, iam, logDebug(), logError(), roto_complete_cmd(), roto_recbuff, roto_recv_cmdreply(), roto_send_command(), roto_verbose, and rototalk_err_notconnected.

Referenced by send_bogus_stuff(), BeamData::send_data(), send_whole_file(), and RotoClient::SendRecordBuffer().

00466 {
00467    rotocmd cmd;
00468    int32_t     err;
00469 
00470    if (g_roto_conn.conn_socketfd<0) {
00471       logError("roto_send_record: not connected");
00472       return rototalk_err_notconnected;
00473    }
00474 
00475    g_roto_conn.conn_nrec_sent++;
00476 
00477    if (roto_verbose>2) 
00478       logDebug(3,"roto_send_record: record %d, %d bytes",
00479                g_roto_conn.conn_nrec_sent,nbytes);
00480 
00481    /*
00482     * Send "command" in fashion similar to run control protocol
00483     */
00484    cmd = roto_complete_cmd(roto_recbuff,iam);
00485    err = roto_send_command(cmd,buffer,nbytes);
00486    if (err) return err;
00487    /*
00488     * Get the command reply (ACK|NACK + state report)
00489     */
00490    return roto_recv_cmdreply(cmd);
00491 }

int32_t roto_set_connection_nodelay ( int32_t  val  ) 

Definition at line 366 of file rototalk.c.

References roto_conn::conn_socketfd, g_roto_conn, logError(), logWarn(), roto_verbose, and rototalk_err_notconnected.

Referenced by main(), and roto_open_connection().

00367 {
00368    int32_t      err;
00369 
00370    /*
00371     * complain if we aren't actually connected
00372     */
00373    if (g_roto_conn.conn_socketfd<0) {
00374       logError("roto_set_connection_nodelay: not connected");
00375       return rototalk_err_notconnected;
00376    }
00377 
00378    err = setsockopt(g_roto_conn.conn_socketfd,IPPROTO_TCP,TCP_NODELAY,
00379                      (char*)&val, sizeof(val));
00380 
00381    if (roto_verbose>0 && err)
00382       logWarn("roto_set_connection_nodelay returned %d",err);
00383 
00384    return err;
00385 }


Variable Documentation

int32_t roto_verbose

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1