Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
wangjie
OpenXG-RAN
Commits
c2971d51
Commit
c2971d51
authored
Mar 15, 2016
by
Xenofon Foukas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tcp_nodelay option in agent async interface
parent
43b63be5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
openair2/UTIL/ASYNC_IF/socket_link.c
openair2/UTIL/ASYNC_IF/socket_link.c
+16
-1
No files found.
openair2/UTIL/ASYNC_IF/socket_link.c
View file @
c2971d51
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <stdint.h>
#include <stdint.h>
...
@@ -56,7 +57,8 @@ socket_link_t *new_link_server(int port)
...
@@ -56,7 +57,8 @@ socket_link_t *new_link_server(int port)
struct
sockaddr_in
addr
;
struct
sockaddr_in
addr
;
socklen_t
addrlen
;
socklen_t
addrlen
;
int
socket_server
=
-
1
;
int
socket_server
=
-
1
;
int
no_delay
;
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
if
(
ret
==
NULL
)
{
if
(
ret
==
NULL
)
{
LOG_E
(
MAC
,
"%s:%d: out of memory
\n
"
,
__FILE__
,
__LINE__
);
LOG_E
(
MAC
,
"%s:%d: out of memory
\n
"
,
__FILE__
,
__LINE__
);
...
@@ -78,6 +80,12 @@ socket_link_t *new_link_server(int port)
...
@@ -78,6 +80,12 @@ socket_link_t *new_link_server(int port)
goto
error
;
goto
error
;
}
}
no_delay
=
1
;
if
(
setsockopt
(
socket_server
,
IPPROTO_TCP
,
TCP_NODELAY
,
&
no_delay
,
sizeof
(
no_delay
))
==
-
1
)
{
LOG_E
(
MAC
,
"%s:%d: setsockopt: %s
\n
"
,
__FILE__
,
__LINE__
,
strerror
(
errno
));
goto
error
;
}
addr
.
sin_family
=
AF_INET
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
addr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
...
@@ -115,6 +123,7 @@ socket_link_t *new_link_client(char *server, int port)
...
@@ -115,6 +123,7 @@ socket_link_t *new_link_client(char *server, int port)
{
{
socket_link_t
*
ret
=
NULL
;
socket_link_t
*
ret
=
NULL
;
struct
sockaddr_in
addr
;
struct
sockaddr_in
addr
;
int
no_delay
;
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
if
(
ret
==
NULL
)
{
if
(
ret
==
NULL
)
{
...
@@ -131,6 +140,12 @@ socket_link_t *new_link_client(char *server, int port)
...
@@ -131,6 +140,12 @@ socket_link_t *new_link_client(char *server, int port)
goto
error
;
goto
error
;
}
}
no_delay
=
1
;
if
(
setsockopt
(
ret
->
socket_fd
,
SOL_TCP
,
TCP_NODELAY
,
&
no_delay
,
sizeof
(
no_delay
))
==
-
1
)
{
LOG_E
(
MAC
,
"%s:%d: setsockopt: %s
\n
"
,
__FILE__
,
__LINE__
,
strerror
(
errno
));
goto
error
;
}
addr
.
sin_family
=
AF_INET
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_port
=
htons
(
port
);
addr
.
sin_port
=
htons
(
port
);
if
(
inet_aton
(
server
,
&
addr
.
sin_addr
)
==
0
)
{
if
(
inet_aton
(
server
,
&
addr
.
sin_addr
)
==
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