Exemplo n.º 1
0
        public void AcceptCallback(ref SelectControl selectControl, Socket listenSocket, Buf safeBuffer)
        {
            Socket clientSocket = listenSocket.Accept();

            if (clientSocket.Connected)
            {
                String clientLogString = clientSocket.SafeRemoteEndPointString();

                var dataHandler = new NpcSocketHandler(clientLogString, callback, npcExecutor, htmlGenerator);
                selectControl.AddReceiveSocket(clientSocket, dataHandler.InitialRecvHandler);
            }
            else
            {
                clientSocket.Close();
            }
        }
Exemplo n.º 2
0
 // returns the number of bytes to respond with
 public abstract UInt32 HandleRecord(String clientString,
                                     Byte[] record, UInt32 offset, UInt32 offsetLimit,
                                     Buf sendBuffer, UInt32 sendOffset);
Exemplo n.º 3
0
 public OffsetLineParser(Buf buffer)
 {
     this.buffer        = buffer;
     this.count         = 0;
     this.nextLineStart = 0;
 }
Exemplo n.º 4
0
 public RecordServerHandler(String serviceName, Buf sendBuffer)
 {
     this.serviceName = serviceName;
     //this.socketToRecordParser = new Dictionary<Socket, RecordBuilder>();
     this.sendBuffer = sendBuffer;
 }