LibUv Networking (#65)
This commit is contained in:
parent
ec6629fbe9
commit
5e2be2d7b6
69 changed files with 5612 additions and 586 deletions
|
|
@ -1,22 +1,22 @@
|
|||
/***************************************************************************
|
||||
* SocketExtensions.cs
|
||||
* -------------------
|
||||
* begin : August 2, 2019
|
||||
* copyright : (C) The ModernUO Team
|
||||
* email : hi@modernuo.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
/*************************************************************************
|
||||
* ModernUO *
|
||||
* Copyright (C) 2019 - ModernUO Development Team *
|
||||
* Email: hi@modernuo.com *
|
||||
* File: SocketExtensions.cs - Created: 2019/08/02 - Updated: 2019/12/24 *
|
||||
* *
|
||||
* This program is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Buffers;
|
||||
|
|
@ -34,7 +34,7 @@ namespace Server.Network
|
|||
|
||||
public static ArraySegment<byte> GetArray(this ReadOnlyMemory<byte> memory)
|
||||
{
|
||||
if (MemoryMarshal.TryGetArray(memory, out var result))
|
||||
if (MemoryMarshal.TryGetArray(memory, out ArraySegment<byte> result))
|
||||
return result;
|
||||
|
||||
throw new InvalidOperationException("Buffer backed by array was expected");
|
||||
|
|
@ -42,7 +42,7 @@ namespace Server.Network
|
|||
|
||||
public static ArraySegment<byte> GetArray(this ReadOnlySequence<byte> memory)
|
||||
{
|
||||
if (SequenceMarshal.TryGetArray(memory, out var result))
|
||||
if (SequenceMarshal.TryGetArray(memory, out ArraySegment<byte> result))
|
||||
return result;
|
||||
|
||||
throw new InvalidOperationException("Buffer backed by array was expected");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue