Exemplo n.º 1
0
 void HandleCLOSE(CommandConnection connection, TcpCommandParams parameters)
 {
     try {
         SendResponseAndClose(connection, parameters.Command, "100");
     }
     catch (SocketError) { }
 }
Exemplo n.º 2
0
        void HandleGETLINES(CommandConnection connection, TcpCommandParams parameters)
        {
            SendResponse(connection, parameters.Command, "100");

            StringCollectionEx lines = new StringCollectionEx();

            lines.Add("This is a first line of data");
            lines.Add("This is a second line of data");
            lines.Add("This is a third line of data");

            SendMultipleLines(connection, lines, ".");
        }
Exemplo n.º 3
0
 void HandleNullCommand(CommandConnection connection, TcpCommandParams parameters)
 {
     throw new TcpCommandServerError(parameters.Command, "101", -1, false);
 }
Exemplo n.º 4
0
 void HandleSENDLINESData(CommandConnection connection, TcpCommandParams parameters)
 {
     AcceptCommands(connection);
     OnLinesSent(new MyLinesSentEventArgs(connection, parameters.RawData.ToArray()));
     SendResponse(connection, "SENDLINES", "100");
 }
Exemplo n.º 5
0
 void HandleSENDLINES(CommandConnection connection, TcpCommandParams parameters)
 {
     AcceptMultipleLines(connection, new MyCommandInfo(parameters.Command, new MyCommandHandler(HandleSENDLINESData)));
     SendResponse(connection, parameters.Command, "100");
 }
Exemplo n.º 6
0
 void HandleLOGIN(CommandConnection connection, TcpCommandParams parameters)
 {
     SendResponse(connection, parameters.Command, "100");
 }
Exemplo n.º 7
0
 public override void Execute(CommandConnection connection, TcpCommandParams parameters)
 {
     handler((CommandConnection)connection, parameters);
 }
Exemplo n.º 8
0
 protected override TcpCommandInfo GetNullCommand(TcpCommandParams parameters)
 {
     return(new MyCommandInfo(parameters.Command, new MyCommandHandler(HandleNullCommand)));
 }
Exemplo n.º 9
0
 protected override void ProcessUnhandledError(CommandConnection connection,
                                               TcpCommandParams parameters, Exception ex)
 {
     SendResponse(connection, parameters.Command, "102");
 }