Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ReadMailReallyFast
code
Commits
9463c054
Commit
9463c054
authored
4 years ago
by
Leon Dietrich
Browse files
Options
Downloads
Patches
Plain Diff
chg: connection_client incomminb data cb to ptr of string
parent
d6e0e92e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/net/connection_client.hpp
+1
-1
1 addition, 1 deletion
src/net/connection_client.hpp
src/net/tcp_client.cpp
+2
-2
2 additions, 2 deletions
src/net/tcp_client.cpp
src/net/tcp_client.hpp
+1
-0
1 addition, 0 deletions
src/net/tcp_client.hpp
with
4 additions
and
3 deletions
src/net/connection_client.hpp
+
1
−
1
View file @
9463c054
...
...
@@ -15,7 +15,7 @@ namespace rmrf::net {
class
connection_client
:
public
std
::
enable_shared_from_this
<
connection_client
>
{
public:
typedef
std
::
function
<
void
(
std
::
string
)
>
incomming_data_cb
;
typedef
std
::
function
<
void
(
std
::
shared_ptr
<
std
::
string
>
)
>
incomming_data_cb
;
protected:
incomming_data_cb
in_data_cb
;
public:
...
...
This diff is collapsed.
Click to expand it.
src/net/tcp_client.cpp
+
2
−
2
View file @
9463c054
...
...
@@ -56,11 +56,11 @@ void tcp_client::write_data(std::string data) {
this
->
write_queue
.
push_back
(
std
::
make_shared
<
impl
::
NICBuffer
>
(
data
.
c_str
(),
data
.
size
()));
}
std
::
string
buffer_to_string
(
char
*
buffer
,
ssize_t
bufflen
)
inline
std
::
shared_ptr
<
std
::
string
>
buffer_to_string
(
char
*
buffer
,
ssize_t
bufflen
)
{
// For some wired reaseon the compiler refuses to find the correct constructor of string
// without this extra method.
std
::
string
ret
(
buffer
,
(
int
)
bufflen
);
std
::
shared_ptr
<
std
::
string
>
ret
=
std
::
make_shared
<
std
::
string
>
(
buffer
,
(
int
)
bufflen
);
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
src/net/tcp_client.hpp
+
1
−
0
View file @
9463c054
...
...
@@ -53,6 +53,7 @@ private:
std
::
list
<
std
::
shared_ptr
<
impl
::
NICBuffer
>>
write_queue
;
public:
tcp_client
(
const
destructor_cb_type
destructor_cb_
,
auto_fd
&&
socket_fd
,
std
::
string
peer_address_
,
uint16_t
port_
);
tcp_client
(
const
std
::
string
);
virtual
~
tcp_client
();
virtual
void
write_data
(
std
::
string
data
);
std
::
string
get_peer_address
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment