Ejemplo n.º 1
0
        public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow, EncryptionType encryptionType)
        {
            sock             = cl;
            sock.SendTimeout = 20000;           // 20 seconds timeout
            sock.LingerState = new LingerOption(false, 0);
            sock.NoDelay     = true;
            // NOT WORKING IN EMULATOR sock.ExclusiveAddressUse = true;

            buffer      = "";
            OnReadBytes = readevt;
            encType     = encryptionType;
            encStage    = 0;
            encComplete = encType == EncryptionType.None;
            OnRead      = read;
            MessageType = MessageType.EndMarker;
            dir         = d;
            delim       = "\n";
            id          = NextID;
            // Assign each client an application-unique ID
            unchecked {
                NextID++;
            }
            //t = new ClientThread(this);
            if (StartNow)
            {
                BeginReceive();
            }
        }
Ejemplo n.º 2
0
 public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow, EncryptionType encryptionType)
 {
     sock        = cl;
     buffer      = "";
     OnReadBytes = readevt;
     encType     = encryptionType;
     encStage    = 0;
     encComplete = encType == EncryptionType.None;
     OnRead      = read;
     MessageType = MessageType.EndMarker;
     dir         = d;
     delim       = "\n";
     id          = NextID;
     // Assign each client an application-unique ID
     unchecked {
         NextID++;
     }
     //t = new ClientThread(this);
     if (StartNow)
     {
         BeginReceive();
     }
 }
Ejemplo n.º 3
0
 public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow, EncryptionType encryptionType)
 {
     sock = cl; buffer = ""; OnReadBytes = readevt; encType = encryptionType;
     encStage = 0; encComplete = encType == EncryptionType.None;
     OnRead = read;
     MessageType = MessageType.EndMarker;
     dir = d; delim = "\n";
     id = NextID; // Assign each client an application-unique ID
     unchecked { NextID++; }
     //t = new ClientThread(this);
     if (StartNow) BeginReceive();
 }
Ejemplo n.º 4
0
 //public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d) : this(cl, read, readevt, d, true, EncryptionType.None) {}
 public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow) : this(cl, read, readevt, d, StartNow, EncryptionType.None) { }
Ejemplo n.º 5
0
        public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow, EncryptionType encryptionType)
        {
            sock = cl;
            sock.SendTimeout=20000; // 20 seconds timeout
            sock.LingerState = new LingerOption(false,0);
            sock.NoDelay = true;
            // NOT WORKING IN EMULATOR sock.ExclusiveAddressUse = true;

            buffer = "";
            OnReadBytes = readevt;
            encType = encryptionType;
            encStage = 0;
            encComplete = encType == EncryptionType.None;
            OnRead = read;
            MessageType = MessageType.EndMarker;
            dir = d;
            delim = "\n";
            id = NextID;
            // Assign each client an application-unique ID
            unchecked {
                NextID++;
            }
            //t = new ClientThread(this);
            if (StartNow)
                BeginReceive ();
        }
Ejemplo n.º 6
0
 //public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d) : this(cl, read, readevt, d, true, EncryptionType.None) {}
 public ClientInfo(Socket cl, ConnectionRead read, ConnectionReadBytes readevt, ClientDirection d, bool StartNow) : this(cl, read, readevt, d, StartNow, EncryptionType.None)
 {
 }