using System;
using System.Net;
using System.Net.Sockets;

namespace SharpQuake
{
	internal class qsocket_t
	{
		public INetLanDriver LanDriver
		{
			get
			{
				return net.LanDrivers[this.landriver];
			}
		}

		public void ClearBuffers()
		{
			this.sendMessageLength = 0;
			this.receiveMessageLength = 0;
		}

		public int Read(byte[] buf, int len, ref EndPoint ep)
		{
			return this.LanDriver.Read(this.socket, buf, len, ref ep);
		}

		public int Write(byte[] buf, int len, EndPoint ep)
		{
			return this.LanDriver.Write(this.socket, buf, len, ep);
		}

		public qsocket_t()
		{
			this.sendMessage = new byte[8192];
			this.receiveMessage = new byte[8192];
			this.disconnected = true;
		}

		public double connecttime;

		public double lastMessageTime;

		public double lastSendTime;

		public bool disconnected;

		public bool canSend;

		public bool sendNext;

		public int driver;

		public int landriver;

		public Socket socket;

		public object driverdata;

		public uint ackSequence;

		public uint sendSequence;

		public uint unreliableSendSequence;

		public int sendMessageLength;

		public byte[] sendMessage;

		public uint receiveSequence;

		public uint unreliableReceiveSequence;

		public int receiveMessageLength;

		public byte[] receiveMessage;

		public EndPoint addr;

		public string address;
	}
}
