Commit 85e1531b authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

minor update - code format

parent fba31da2
...@@ -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_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment