private void doReceive(int available) { LastReceive = Time32.Now; try { if (available > Buffer.Length) { available = Buffer.Length; } int size = Socket.Receive(Buffer, available, SocketFlags.None); if (size != 0) { if (Callback != null) { Callback(Buffer, size, this); } } else { Server.InvokeDisconnect(this); } } catch (SocketException) { Server.InvokeDisconnect(this); } catch (Exception e) { Console.WriteLine(e); } }
public bool Next(int due = 0, int time = 0) { if (time == 0) { time = (int)Time32.timeGetTime().Value; } return(this.Value + due <= time); }