@@ -9,11 +9,7 @@ namespace LiteNetLib
9
9
{
10
10
internal static class NativeSocket
11
11
{
12
- static
13
- #if LITENETLIB_UNSAFE
14
- unsafe
15
- #endif
16
- class WinSock
12
+ static unsafe class WinSock
17
13
{
18
14
private const string LibName = "ws2_32.dll" ;
19
15
@@ -29,22 +25,14 @@ public static extern int recvfrom(
29
25
[ DllImport ( LibName , SetLastError = true ) ]
30
26
internal static extern int sendto (
31
27
IntPtr socketHandle ,
32
- #if LITENETLIB_UNSAFE
33
28
byte * pinnedBuffer ,
34
- #else
35
- [ In ] byte [ ] pinnedBuffer ,
36
- #endif
37
29
[ In ] int len ,
38
30
[ In ] SocketFlags socketFlags ,
39
31
[ In ] byte [ ] socketAddress ,
40
32
[ In ] int socketAddressSize ) ;
41
33
}
42
34
43
- static
44
- #if LITENETLIB_UNSAFE
45
- unsafe
46
- #endif
47
- class UnixSock
35
+ static unsafe class UnixSock
48
36
{
49
37
private const string LibName = "libc" ;
50
38
@@ -60,11 +48,7 @@ public static extern int recvfrom(
60
48
[ DllImport ( LibName , SetLastError = true ) ]
61
49
internal static extern int sendto (
62
50
IntPtr socketHandle ,
63
- #if LITENETLIB_UNSAFE
64
51
byte * pinnedBuffer ,
65
- #else
66
- [ In ] byte [ ] pinnedBuffer ,
67
- #endif
68
52
[ In ] int len ,
69
53
[ In ] SocketFlags socketFlags ,
70
54
[ In ] byte [ ] socketAddress ,
@@ -152,17 +136,9 @@ public static int RecvFrom(
152
136
}
153
137
154
138
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
155
- public
156
- #if LITENETLIB_UNSAFE
157
- unsafe
158
- #endif
159
- static int SendTo (
139
+ public static unsafe int SendTo (
160
140
IntPtr socketHandle ,
161
- #if LITENETLIB_UNSAFE
162
141
byte * pinnedBuffer ,
163
- #else
164
- byte [ ] pinnedBuffer ,
165
- #endif
166
142
int len ,
167
143
byte [ ] socketAddress ,
168
144
int socketAddressSize )
0 commit comments