Browse Source

[netsource] add -B option

tags/v1.9.4
Torben Hohn 16 years ago
parent
commit
061c61816b
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      example-clients/netsource.c

+ 11
- 1
example-clients/netsource.c View File

@@ -80,6 +80,7 @@ jack_nframes_t factor = 1;
int bitdepth = 0;
int mtu = 1400;
int reply_port = 0;
int bind_port = 0;
int redundancy = 1;
jack_client_t *client;

@@ -567,7 +568,7 @@ main (int argc, char *argv[])
sprintf(client_name, "netsource");
sprintf(peer_ip, "localhost");

while ((c = getopt (argc, argv, ":H:R:n:s:h:p:C:P:i:o:l:r:f:b:m:c:")) != -1)
while ((c = getopt (argc, argv, ":H:R:n:s:h:p:C:P:i:o:l:r:f:b:m:c:B:")) != -1)
{
switch (c)
{
@@ -607,6 +608,9 @@ main (int argc, char *argv[])
case 'r':
reply_port = atoi (optarg);
break;
case 'B':
bind_port = atoi (optarg);
break;
case 'f':
factor = atoi (optarg);
break;
@@ -658,6 +662,12 @@ main (int argc, char *argv[])
}

init_sockaddr_in ((struct sockaddr_in *) &destaddr, peer_ip, peer_port);
if(bind_port) {
init_sockaddr_in ((struct sockaddr_in *) &bindaddr, NULL, bind_port);
if( bind (outsockfd, &bindaddr, sizeof (bindaddr)) ) {
fprintf (stderr, "bind failure\n" );
}
}
if(reply_port)
{
init_sockaddr_in ((struct sockaddr_in *) &bindaddr, NULL, reply_port);


Loading…
Cancel
Save