projects
/
my-code
/
ivac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17fdfff
)
first udp tries ...
author
hackbard
<hackbard>
Tue, 18 May 2004 14:06:39 +0000
(14:06 +0000)
committer
hackbard
<hackbard>
Tue, 18 May 2004 14:06:39 +0000
(14:06 +0000)
src/ivac.c
patch
|
blob
|
history
src/ivac.h
patch
|
blob
|
history
diff --git
a/src/ivac.c
b/src/ivac.c
index
9d2b216
..
47d1892
100644
(file)
--- a/
src/ivac.c
+++ b/
src/ivac.c
@@
-21,8
+21,6
@@
*
*/
*
*/
-// #define USE_GTK
-
#include "ivac.h"
int usage(void) {
#include "ivac.h"
int usage(void) {
@@
-34,6
+32,7
@@
int usage(void) {
puts("-h \t\t show this help");
puts("-n <name> \t specify your name");
puts("-p <port> \t specify port to listen for incoming connections");
puts("-h \t\t show this help");
puts("-n <name> \t specify your name");
puts("-p <port> \t specify port to listen for incoming connections");
+ puts("-u <port> \t specify udp data port");
puts("-d <device> \t specify audio device");
puts("");
puts("-d <device> \t specify audio device");
puts("");
@@
-50,6
+49,7
@@
int main(int argc,char **argv) {
/* default values */
strcpy(ivac.username,"ivac");
ivac.net.l_port=IVAC_LISTEN_PORT;
/* default values */
strcpy(ivac.username,"ivac");
ivac.net.l_port=IVAC_LISTEN_PORT;
+ ivac.net.l_udp_port=IVAC_UDP_PORT;
strcpy(ivac.audio.dsp_dev,SOUND_DEVICE);
/* parse argv and change default values */
strcpy(ivac.audio.dsp_dev,SOUND_DEVICE);
/* parse argv and change default values */
@@
-65,6
+65,9
@@
int main(int argc,char **argv) {
case 'p':
ivac.net.l_port=atoi(argv[++i]);
break;
case 'p':
ivac.net.l_port=atoi(argv[++i]);
break;
+ case 'u':
+ ivac.net.l_udp_port=atoi(argv[++i]);
+ break;
case 'd':
strncpy(ivac.audio.dsp_dev,argv[++i],MAX_CHAR_DEVICE);
break;
case 'd':
strncpy(ivac.audio.dsp_dev,argv[++i],MAX_CHAR_DEVICE);
break;
@@
-104,9
+107,11
@@
int main(int argc,char **argv) {
ivac_shutdown(&ivac);
return ERROR;
}
ivac_shutdown(&ivac);
return ERROR;
}
+ network_udp_listen_init(&(ivac.net));
- /* add listening port + stdin to (read) event system */
+ /* add listening port
(s)
+ stdin to (read) event system */
event_math(ivac.net.l_fd,&(ivac.event),READ,ADD);
event_math(ivac.net.l_fd,&(ivac.event),READ,ADD);
+ event_math(ivac.net.l_udp_fd,&(ivac.event),READ,ADD);
event_math(0,&(ivac.event),READ,ADD);
/* display init */
event_math(0,&(ivac.event),READ,ADD);
/* display init */
@@
-132,6
+137,7
@@
int main(int argc,char **argv) {
int ivac_shutdown(t_ivac *ivac) {
network_shutdown(&(ivac->net));
int ivac_shutdown(t_ivac *ivac) {
network_shutdown(&(ivac->net));
+ network_udp_shutdown(&(ivac->net));
input_shutdown(&(ivac->input));
event_stop(&(ivac->event));
audio_shutdown(&(ivac->audio));
input_shutdown(&(ivac->input));
event_stop(&(ivac->event));
audio_shutdown(&(ivac->audio));
diff --git
a/src/ivac.h
b/src/ivac.h
index
c8ac919
..
2bd69c5
100644
(file)
--- a/
src/ivac.h
+++ b/
src/ivac.h
@@
-19,6
+19,7
@@
#define SUCCESS 1
#define IVAC_LISTEN_PORT 1025
#define SUCCESS 1
#define IVAC_LISTEN_PORT 1025
+#define IVAC_UDP_PORT 1026
#define IVAC_S_SEC 2
#define IVAC_S_USEC 500
#define IVAC_S_SEC 2
#define IVAC_S_USEC 500