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
17
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
9f4085f6
Commit
9f4085f6
authored
4 years ago
by
Constantin P.
💬
Committed by
dmitriy.gerasimov
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
NBIO for winsock
parent
40139374
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap-sdk/net/core/dap_events_socket.c
+9
-7
9 additions, 7 deletions
dap-sdk/net/core/dap_events_socket.c
with
9 additions
and
7 deletions
dap-sdk/net/core/dap_events_socket.c
+
9
−
7
View file @
9f4085f6
...
@@ -325,7 +325,8 @@ dap_events_socket_t * dap_events_socket_create(dap_events_desc_type_t a_type, da
...
@@ -325,7 +325,8 @@ dap_events_socket_t * dap_events_socket_create(dap_events_desc_type_t a_type, da
case
DESCRIPTOR_TYPE_SOCKET_LOCAL_LISTENING
:
case
DESCRIPTOR_TYPE_SOCKET_LOCAL_LISTENING
:
#ifdef DAP_OS_UNIX
#ifdef DAP_OS_UNIX
l_sock_class
=
AF_LOCAL
;
l_sock_class
=
AF_LOCAL
;
#elif DAP_OS_WIDNOWS
#elif defined DAP_OS_WINDOWS
l_sock_class
=
AF_UNIX
;
#endif
#endif
break
;
break
;
default:
default:
...
@@ -333,17 +334,18 @@ dap_events_socket_t * dap_events_socket_create(dap_events_desc_type_t a_type, da
...
@@ -333,17 +334,18 @@ dap_events_socket_t * dap_events_socket_create(dap_events_desc_type_t a_type, da
return
NULL
;
return
NULL
;
}
}
#ifdef WIN32
#ifdef DAP_OS_WINDOWS
SOCKET
l_sock
;
SOCKET
l_sock
=
socket
(
l_sock_class
,
l_sock_type
,
IPPROTO_IP
);
u_long
l_socket_flags
=
1
;
if
(
ioctlsocket
((
SOCKET
)
l_sock
,
(
long
)
FIONBIO
,
&
l_socket_flags
))
log_it
(
L_ERROR
,
"Error ioctl %d"
,
WSAGetLastError
());
#else
#else
int
l_sock
;
int
l_sock
=
socket
(
l_sock_class
,
l_sock_type
|
SOCK_NONBLOCK
,
0
);
#endif
l_sock
=
socket
(
l_sock_class
,
l_sock_type
|
SOCK_NONBLOCK
,
0
);
if
(
l_sock
==
INVALID_SOCKET
)
{
if
(
l_sock
==
INVALID_SOCKET
)
{
log_it
(
L_ERROR
,
"Socket create error"
);
log_it
(
L_ERROR
,
"Socket create error"
);
return
NULL
;
return
NULL
;
}
}
#endif
dap_events_socket_t
*
l_es
=
dap_events_socket_wrap_no_add
(
dap_events_get_default
(),
l_sock
,
a_callbacks
);
dap_events_socket_t
*
l_es
=
dap_events_socket_wrap_no_add
(
dap_events_get_default
(),
l_sock
,
a_callbacks
);
if
(
!
l_es
){
if
(
!
l_es
){
log_it
(
L_CRITICAL
,
"Can't allocate memory for the new esocket"
);
log_it
(
L_CRITICAL
,
"Can't allocate memory for the new esocket"
);
...
...
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