Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
7318ca89
Commit
7318ca89
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Add experimental mock support
parent
06b85eed
No related branches found
No related tags found
No related merge requests found
Pipeline
#9605
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/cpp/src/socket.cpp
+20
-0
20 additions, 0 deletions
net/cpp/src/socket.cpp
with
20 additions
and
0 deletions
net/cpp/src/socket.cpp
+
20
−
0
View file @
7318ca89
...
...
@@ -35,6 +35,26 @@ using ftl::URI;
using
ftl
::
net
::
ws_connect
;
using
namespace
std
;
namespace
ftl
{
namespace
net
{
namespace
internal
{
#ifdef TEST_MOCKS
#ifdef WIN32
extern
int
recv
(
SOCKET
sd
,
char
*
buf
,
int
n
,
int
f
);
extern
int
send
(
SOCKET
sd
,
const
char
*
v
,
int
cnt
,
int
flags
);
#else
extern
ssize_t
recv
(
int
sd
,
void
*
buf
,
size_t
n
,
int
f
);
extern
ssize_t
writev
(
int
sd
,
const
struct
iovec
*
v
,
int
cnt
);
#endif
#else
#ifdef WIN32
inline
int
recv
(
SOCKET
sd
,
char
*
buf
,
int
n
,
int
f
)
{
return
::
recv
(
sd
,
buf
,
n
,
f
);
}
inline
int
send
(
SOCKET
sd
,
const
char
*
v
,
int
cnt
,
int
flags
)
{
return
::
send
(
sd
,
v
,
cnt
,
flags
);
}
#else
inline
ssize_t
recv
(
int
sd
,
void
*
buf
,
size_t
n
,
int
f
)
{
return
::
recv
(
sd
,
buf
,
n
,
f
);
}
inline
ssize_t
writev
(
int
sd
,
const
struct
iovec
*
v
,
int
cnt
)
{
return
::
writev
(
sd
,
v
,
cnt
);
}
#endif
#endif
}}}
/*static std::string hexStr(const std::string &s)
{
const char *data = s.data();
...
...
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