-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
Description
libzt/src/bindings/csharp/Socket.cs
Lines 297 to 322 in 2f0f25a
| public Int32 Send(Byte[] buffer) | |
| { | |
| return Send(buffer, 0, buffer != null ? buffer.Length : 0, SocketFlags.None); | |
| } | |
| public Int32 Send(Byte[] buffer, int offset, int size, SocketFlags socketFlags) | |
| { | |
| if (_isClosed) { | |
| throw new ObjectDisposedException("Socket has been closed"); | |
| } | |
| if (_fd < 0) { | |
| throw new ZeroTier.Sockets.SocketException((int)ZeroTier.Constants.ERR_SOCKET); | |
| } | |
| if (buffer == null) { | |
| throw new ArgumentNullException("buffer"); | |
| } | |
| if (size < 0 || size > buffer.Length - offset) { | |
| throw new ArgumentOutOfRangeException("size"); | |
| } | |
| if (offset < 0 || offset > buffer.Length) { | |
| throw new ArgumentOutOfRangeException("offset"); | |
| } | |
| int flags = 0; | |
| IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0); | |
| return zts_bsd_send(_fd, bufferPtr + offset, (uint)Buffer.ByteLength(buffer), (int)flags); | |
| } |
size parameter is just... ignored. Sure this would not be surprising.
joseph-henry