Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
407cdfb1
Commit
407cdfb1
authored
Feb 05, 2007
by
Dafydd Harries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy up udp-echo-server
darcs-hash:20070205163624-c9803-6a9b377e3890e7b038ac52bae6190301dd2c6509.gz
parent
85e88fa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
udp/udp-echo-server.c
udp/udp-echo-server.c
+13
-7
No files found.
udp/udp-echo-server.c
View file @
407cdfb1
...
@@ -4,16 +4,16 @@
...
@@ -4,16 +4,16 @@
gint
gint
main
(
void
)
main
(
void
)
{
{
NiceUDPSocketFactory
man
;
NiceUDPSocketFactory
factory
;
NiceUDPSocket
sock
;
NiceUDPSocket
sock
;
NiceAddress
addr
=
{
0
,};
NiceAddress
addr
=
{
0
,};
nice_udp_bsd_socket_factory_init
(
&
man
);
nice_udp_bsd_socket_factory_init
(
&
factory
);
addr
.
port
=
9999
;
addr
.
port
=
9999
;
if
(
!
man
.
init
(
&
man
,
&
sock
,
&
addr
))
if
(
!
nice_udp_socket_factory_make
(
&
factory
,
&
sock
,
&
addr
))
{
{
g_debug
(
"failed to
f
ind to port 9999: server already running?"
);
g_debug
(
"failed to
b
ind to port 9999: server already running?"
);
return
1
;
return
1
;
}
}
...
@@ -22,11 +22,17 @@ main (void)
...
@@ -22,11 +22,17 @@ main (void)
gchar
buf
[
1024
];
gchar
buf
[
1024
];
guint
length
;
guint
length
;
length
=
sock
.
recv
(
&
sock
,
&
addr
,
sizeof
(
buf
),
buf
);
length
=
nice_udp_socket_
recv
(
&
sock
,
&
addr
,
sizeof
(
buf
),
buf
);
#ifdef DEBUG
#ifdef DEBUG
g_debug
(
"%s:%d"
,
inet_ntoa
(
sin
.
sin_addr
),
ntohs
(
sin
.
sin_port
));
{
gchar
*
ip
;
ip
=
nice_address_to_string
(
&
addr
);
g_debug
(
"%s:%d"
,
ip
,
addr
.
port
);
g_free
(
ip
);
}
#endif
#endif
sock
.
send
(
&
sock
,
&
addr
,
length
,
buf
);
nice_udp_socket_
send
(
&
sock
,
&
addr
,
length
,
buf
);
}
}
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment