Restructuring of the files
This commit is contained in:
29
Facepunch.Steamworks/Networking/Socket.cs
Normal file
29
Facepunch.Steamworks/Networking/Socket.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Facepunch.Steamworks.Data
|
||||
{
|
||||
[StructLayout( LayoutKind.Sequential )]
|
||||
public struct Socket
|
||||
{
|
||||
internal uint Id;
|
||||
public override string ToString() => Id.ToString();
|
||||
public static implicit operator Socket( uint value ) => new Socket() { Id = value };
|
||||
public static implicit operator uint( Socket value ) => value.Id;
|
||||
|
||||
/// <summary>
|
||||
/// Destroy a listen socket. All the connections that were accepting on the listen
|
||||
/// socket are closed ungracefully.
|
||||
/// </summary>
|
||||
public bool Close()
|
||||
{
|
||||
return SteamNetworkingSockets.Internal.CloseListenSocket( Id );
|
||||
}
|
||||
|
||||
public SocketManager Manager
|
||||
{
|
||||
get => SteamNetworkingSockets.GetSocketManager( Id );
|
||||
set => SteamNetworkingSockets.SetSocketManager( Id, value );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user