少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/**
 * \file
 *
 * Copyright 2016 Microsoft
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
#ifndef __MONO_METADATA_W32SOCKET_INTERNALS_H__
#define __MONO_METADATA_W32SOCKET_INTERNALS_H__
 
#include <config.h>
#include <glib.h>
 
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
 
#include <mono/utils/w32api.h>
 
#ifndef HAVE_SOCKLEN_T
#define socklen_t int
#endif
 
#ifndef HOST_WIN32
 
#define TF_DISCONNECT 0x01
#define TF_REUSE_SOCKET 0x02
 
typedef struct {
    gpointer Head;
    guint32 HeadLength;
    gpointer Tail;
    guint32 TailLength;
} TRANSMIT_FILE_BUFFERS, *LPTRANSMIT_FILE_BUFFERS;
 
typedef struct {
    guint32 Data1;
    guint16 Data2;
    guint16 Data3;
    guint8 Data4[8];
} GUID;
 
typedef struct {
    guint32 Internal;
    guint32 InternalHigh;
    guint32 Offset;
    guint32 OffsetHigh;
    gpointer hEvent;
    gpointer handle1;
    gpointer handle2;
} OVERLAPPED;
 
#endif
 
void
mono_w32socket_initialize (void);
 
void
mono_w32socket_cleanup (void);
 
SOCKET
mono_w32socket_accept (SOCKET s, struct sockaddr *addr, socklen_t *addrlen, gboolean blocking);
 
SOCKET
mono_w32socket_accept_internal (SOCKET s, struct sockaddr *addr, socklen_t *addrlen, gboolean blocking);
 
int
mono_w32socket_connect (SOCKET s, const struct sockaddr *name, int namelen, gboolean blocking);
 
int
mono_w32socket_recv (SOCKET s, char *buf, int len, int flags, gboolean blocking);
 
int
mono_w32socket_recvfrom (SOCKET s, char *buf, int len, int flags, struct sockaddr *from, socklen_t *fromlen, gboolean blocking);
 
int
mono_w32socket_recvbuffers (SOCKET s, LPWSABUF lpBuffers, guint32 dwBufferCount, guint32 *lpNumberOfBytesRecvd, guint32 *lpFlags, gpointer lpOverlapped, gpointer lpCompletionRoutine, gboolean blocking);
 
int
mono_w32socket_send (SOCKET s, char *buf, int len, int flags, gboolean blocking);
 
int
mono_w32socket_sendto (SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen, gboolean blocking);
 
int
mono_w32socket_sendbuffers (SOCKET s, LPWSABUF lpBuffers, guint32 dwBufferCount, guint32 *lpNumberOfBytesRecvd, guint32 lpFlags, gpointer lpOverlapped, gpointer lpCompletionRoutine, gboolean blocking);
 
#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT | HAVE_UWP_WINAPI_SUPPORT)
 
BOOL
mono_w32socket_transmit_file (SOCKET hSocket, gpointer hFile, LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers, guint32 dwReserved, gboolean blocking);
 
#endif
 
#ifndef HOST_WIN32
 
SOCKET
mono_w32socket_socket (int domain, int type, int protocol);
 
gint
mono_w32socket_bind (SOCKET sock, struct sockaddr *addr, socklen_t addrlen);
 
gint
mono_w32socket_getpeername (SOCKET sock, struct sockaddr *name, socklen_t *namelen);
 
gint
mono_w32socket_getsockname (SOCKET sock, struct sockaddr *name, socklen_t *namelen);
 
gint
mono_w32socket_getsockopt (SOCKET sock, gint level, gint optname, gpointer optval, socklen_t *optlen);
 
gint
mono_w32socket_setsockopt (SOCKET sock, gint level, gint optname, const gpointer optval, socklen_t optlen);
 
gint
mono_w32socket_listen (SOCKET sock, gint backlog);
 
gint
mono_w32socket_shutdown (SOCKET sock, gint how);
 
gint
mono_w32socket_ioctl (SOCKET sock, gint32 command, gchar *input, gint inputlen, gchar *output, gint outputlen, glong *written);
 
gboolean
mono_w32socket_close (SOCKET sock);
 
#endif /* HOST_WIN32 */
 
gint
mono_w32socket_disconnect (SOCKET sock, gboolean reuse);
 
gint
mono_w32socket_set_blocking (SOCKET socket, gboolean blocking);
 
gint
mono_w32socket_get_available (SOCKET socket, guint64 *amount);
 
void
mono_w32socket_set_last_error (gint32 error);
 
gint32
mono_w32socket_get_last_error (void);
 
gint32
mono_w32socket_convert_error (gint error);
 
gboolean
mono_w32socket_duplicate (gpointer handle, gint32 targetProcessId, gpointer *duplicate_handle);
 
#endif // __MONO_METADATA_W32SOCKET_INTERNALS_H__