Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
18
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
cellframe
cellframe-sdk
Commits
50cfa2dd
Commit
50cfa2dd
authored
5 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'support-2719' into 'master'
Winsock issues See merge request
libdap-chain-net!70
parents
a048fb0f
fb9dcf2b
Loading
Loading
1 merge request
!24
Support 3689
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_chain_node_cli.c
+17
-3
17 additions, 3 deletions
dap_chain_node_cli.c
with
17 additions
and
3 deletions
dap_chain_node_cli.c
+
17
−
3
View file @
50cfa2dd
...
@@ -776,6 +776,15 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
...
@@ -776,6 +776,15 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
return
0
;
return
0
;
}
}
#ifdef __WIN32
WSADATA
wsaData
;
int
ret
=
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
wsaData
);
if
(
ret
!=
0
)
{
log_it
(
L_CRITICAL
,
"Couldn't init Winsock DLL, error: %d"
,
ret
);
return
2
;
}
#endif
dap_chain_node_cli_cmd_item_create
(
"global_db"
,
com_global_db
,
"Work with global database"
,
dap_chain_node_cli_cmd_item_create
(
"global_db"
,
com_global_db
,
"Work with global database"
,
"global_db cells add -cell <cell id>
\n
"
"global_db cells add -cell <cell id>
\n
"
"global_db flush
\n\n
"
"global_db flush
\n\n
"
...
@@ -930,13 +939,16 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
...
@@ -930,13 +939,16 @@ int dap_chain_node_cli_init(dap_config_t * g_config)
// create socket
// create socket
if
(
(
sockfd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
if
(
(
sockfd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
==
INVALID_SOCKET
)
{
log_it
(
L_ERROR
,
"Console Server: can't create socket, err %X"
,
errno
);
#ifdef __WIN32
_set_errno
(
WSAGetLastError
());
#endif
log_it
(
L_ERROR
,
"Console Server: can't create socket, err %d"
,
errno
);
return
-
3
;
return
-
3
;
}
}
// connecting the address with a socket
// connecting the address with a socket
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
server_addr
,
sizeof
(
server_addr
))
==
SOCKET_ERROR
)
{
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
server_addr
,
sizeof
(
server_addr
))
==
SOCKET_ERROR
)
{
log_it
(
L_ERROR
,
"Console Server: can't bind socket, err %
X
"
,
errno
);
log_it
(
L_ERROR
,
"Console Server: can't bind socket, err %
d
"
,
errno
);
closesocket
(
sockfd
);
closesocket
(
sockfd
);
return
-
4
;
return
-
4
;
}
}
...
@@ -969,7 +981,9 @@ void dap_chain_node_cli_delete(void)
...
@@ -969,7 +981,9 @@ void dap_chain_node_cli_delete(void)
{
{
if
(
server_sockfd
>=
0
)
if
(
server_sockfd
>=
0
)
closesocket
(
server_sockfd
);
closesocket
(
server_sockfd
);
#ifdef __WIN32
WSACleanup
();
#endif
// deinit client for handshake
// deinit client for handshake
dap_chain_node_client_deinit
();
dap_chain_node_client_deinit
();
}
}
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