Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-SMF
Commits
85e1531b
Commit
85e1531b
authored
Jul 27, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor update - code format
parent
fba31da2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/udp/udp.hpp
src/udp/udp.hpp
+5
-4
No files found.
src/udp/udp.hpp
View file @
85e1531b
...
@@ -75,6 +75,7 @@ public:
...
@@ -75,6 +75,7 @@ public:
}
}
}
}
//------------------------------------------------------------------------------
udp_server
(
const
struct
in6_addr
&
address
,
const
uint16_t
port_num
)
udp_server
(
const
struct
in6_addr
&
address
,
const
uint16_t
port_num
)
:
app_
(
nullptr
),
port_
(
port_num
)
:
app_
(
nullptr
),
port_
(
port_num
)
{
{
...
@@ -90,6 +91,7 @@ public:
...
@@ -90,6 +91,7 @@ public:
}
}
}
}
//------------------------------------------------------------------------------
udp_server
(
const
char
*
address
,
const
uint16_t
port_num
)
udp_server
(
const
char
*
address
,
const
uint16_t
port_num
)
:
app_
(
nullptr
),
port_
(
port_num
)
:
app_
(
nullptr
),
port_
(
port_num
)
{
{
...
@@ -111,6 +113,7 @@ public:
...
@@ -111,6 +113,7 @@ public:
void
udp_read_loop
(
const
util
::
thread_sched_params
&
thread_sched_params
);
void
udp_read_loop
(
const
util
::
thread_sched_params
&
thread_sched_params
);
//------------------------------------------------------------------------------
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
endpoint
&
r_endpoint
)
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
endpoint
&
r_endpoint
)
{
{
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
.
addr_storage
,
r_endpoint
.
addr_storage_len
);
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
.
addr_storage
,
r_endpoint
.
addr_storage_len
);
...
@@ -119,6 +122,7 @@ public:
...
@@ -119,6 +122,7 @@ public:
}
}
}
}
//------------------------------------------------------------------------------
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
struct
sockaddr_in
&
r_endpoint
)
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
struct
sockaddr_in
&
r_endpoint
)
{
{
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
,
sizeof
(
struct
sockaddr_in
));
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
,
sizeof
(
struct
sockaddr_in
));
...
@@ -127,6 +131,7 @@ public:
...
@@ -127,6 +131,7 @@ public:
}
}
}
}
//------------------------------------------------------------------------------
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
struct
sockaddr_in6
&
r_endpoint
)
void
async_send_to
(
const
char
*
send_buffer
,
const
ssize_t
num_bytes
,
const
struct
sockaddr_in6
&
r_endpoint
)
{
{
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
,
sizeof
(
struct
sockaddr_in6
));
ssize_t
bytes_written
=
sendto
(
socket_
,
send_buffer
,
num_bytes
,
0
,
(
struct
sockaddr
*
)
&
r_endpoint
,
sizeof
(
struct
sockaddr_in6
));
...
@@ -135,7 +140,6 @@ public:
...
@@ -135,7 +140,6 @@ public:
}
}
}
}
void
start_receive
(
udp_application
*
gtp_stack
,
const
util
::
thread_sched_params
&
sched_params
);
void
start_receive
(
udp_application
*
gtp_stack
,
const
util
::
thread_sched_params
&
sched_params
);
protected:
protected:
...
@@ -143,15 +147,12 @@ protected:
...
@@ -143,15 +147,12 @@ protected:
int
create_socket
(
const
struct
in6_addr
&
address
,
const
uint16_t
port
);
int
create_socket
(
const
struct
in6_addr
&
address
,
const
uint16_t
port
);
int
create_socket
(
const
char
*
address
,
const
uint16_t
port_num
);
int
create_socket
(
const
char
*
address
,
const
uint16_t
port_num
);
// void handle_receive(const int& error, std::size_t bytes_transferred);
static
void
handle_send
(
const
char
*
,
/*buffer*/
static
void
handle_send
(
const
char
*
,
/*buffer*/
const
int
&
/*error*/
,
const
int
&
/*error*/
,
std
::
size_t
/*bytes_transferred*/
)
std
::
size_t
/*bytes_transferred*/
)
{
{
}
}
udp_application
*
app_
;
udp_application
*
app_
;
std
::
thread
thread_
;
std
::
thread
thread_
;
int
socket_
;
int
socket_
;
...
...
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