public Client(Socket sock, ushort size)
{
try
{
Initialize();
Items[0].SetBuffer(new byte[size], 0, size);
_handle = sock;
_handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
_handle.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true);
_handle.NoDelay = true;
BufferSize = size;
_endPoint = (IPEndPoint)_handle.RemoteEndPoint;
Connected = true;
if (!_handle.ReceiveAsync(Items[0]))
Process(null, Items[0]);
}
catch
{
Disconnect();
}
}