Changeset 3719:e05c9be26060 in roaraudio


Ignore:
Timestamp:
04/25/10 05:03:36 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added function to pass clients

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/client.c

    r3717 r3719  
    8888} 
    8989 
    90 int roar_client_pass     (struct roar_connection * con, struct roar_client * client); 
     90int roar_client_pass     (struct roar_connection * con, struct roar_client * client, uint16_t flags) { 
     91 struct roar_message m; 
     92 int16_t * d = (int16_t *)m.data; 
     93 int confh; 
     94 int i; 
     95 
     96 m.cmd     = ROAR_CMD_PASSFH; 
     97 m.stream  =  -1; // client (non-stream) passs 
     98 m.pos     =   0; 
     99 m.datalen = 4*2; 
     100 
     101 d[0] = 0; // version 
     102 d[1] = flags; 
     103 d[2] = client->proto; 
     104 d[3] = client->byteorder; 
     105 
     106 for (i = 0; i < 4; i++) 
     107  d[i] = ROAR_HOST2NET16(d[i]); 
     108 
     109 if ( (confh = roar_get_connection_fh(con)) == -1 ) 
     110  return -1; 
     111 
     112 if ( roar_send_message(con, &m, NULL) == -1 ) { 
     113  return -1; 
     114 } 
     115 
     116 if ( roar_socket_send_fh(confh, client->fh, NULL, 0) == -1 ) 
     117  return -1; 
     118 
     119 if ( roar_recv_message(con, &m, NULL) == -1 ) 
     120  return -1; 
     121 
     122 if ( m.cmd == ROAR_CMD_OK ) 
     123  return 0; 
     124 
     125 return -1; 
     126} 
    91127 
    92128//ll 
Note: See TracChangeset for help on using the changeset viewer.