Skip to main content
Version: 2.x

Class SocketCollection

Intern socket dictionary

Declaration
public class SocketCollection : IReadOnlyCollection<Socket>, IEnumerable<Socket>, IEnumerable, IEqualityComparer<Socket>

Implements:
System.Collections.Generic.IReadOnlyCollection<OdinNative.Wrapper.Socket.Socket> , System.Collections.Generic.IEnumerable<OdinNative.Wrapper.Socket.Socket> , System.Collections.IEnumerable , System.Collections.Generic.IEqualityComparer<OdinNative.Wrapper.Socket.Socket>

Properties

this[ulong]

Get socket by Id

Declaration
public Socket this[ulong id] { get; }

Count

Count of sockets in the collection

Declaration
public int Count { get; }

IsRemoveOnly

Indicates whether elements can be removed from the collection

Declaration
public bool IsRemoveOnly { get; }

Methods

Add(Socket)

Add a socket to the collection

Declaration
public bool Add(Socket item)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
OdinNative.Wrapper.Socket.Socketitemsocket to add

GetByLabel(int)

Try to get socket by label

Declaration
public Socket GetByLabel(int key)
Returns

OdinNative.Wrapper.Socket.Socket: Socket

Parameters
TypeNameDescription
System.Int32keySocket OdinNative.Wrapper.Socket.Socket.Label?text=label

Clear()

Free and empty the collection

Declaration
public void Clear()

Contains(Socket)

Determines whether the socket is in the collection

Declaration
public bool Contains(Socket item)
Returns

System.Boolean: true on success or false

Parameters
TypeNameDescription
OdinNative.Wrapper.Socket.Socketitemsocket

Equals(Socket, Socket)

Compares two sockets by hash code

Declaration
public bool Equals(Socket x, Socket y)
Returns

System.Boolean: is equal

Parameters
TypeNameDescription
OdinNative.Wrapper.Socket.Socketxsocket x
OdinNative.Wrapper.Socket.Socketysocket y

GetEnumerator()

Get enumerator for iteration

Declaration
public IEnumerator<Socket> GetEnumerator()
Returns

System.Collections.Generic.IEnumerator<OdinNative.Wrapper.Socket.Socket>: enumerator

GetHashCode(Socket)

Default GetHashCode

Declaration
public int GetHashCode(Socket obj)
Returns

System.Int32: hash code

Parameters
TypeNameDescription
OdinNative.Wrapper.Socket.Socketobjsocket

Remove(ulong)

Removes the socket from this collection

Declaration
public bool Remove(ulong id)
Returns

System.Boolean: is removed

Parameters
TypeNameDescription
System.UInt64idsocket id OdinNative.Wrapper.Socket.Socket.GetSocketId()

Reset(Socket)

Reset a socket

Declaration
public bool Reset(Socket socket)
Returns

System.Boolean: true if socket to reset found

Parameters
TypeNameDescription
OdinNative.Wrapper.Socket.Socketsocketsocket

Reset(ulong)

Reset a socket

Declaration
public bool Reset(ulong id)
Returns

System.Boolean: true if socket to reset is found

Parameters
TypeName
System.UInt64id

Implements

  • System.Collections.Generic.IReadOnlyCollection<OdinNative.Wrapper.Socket.Socket>
  • System.Collections.Generic.IEnumerable<OdinNative.Wrapper.Socket.Socket>
  • System.Collections.IEnumerable
  • System.Collections.Generic.IEqualityComparer<OdinNative.Wrapper.Socket.Socket>