Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1001678 // talkToSubBot

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (3117L) is out of date.

static DialogIO talkToSubBot(final long vport, final DialogIO io) {
  ret talkToSubBot(String.valueOf(vport), io);
}

static DialogIO talkToSubBot(final S subBot, final DialogIO io) {
  if (subBot == null) ret io;
  ret new talkToSubBot_IO(subBot, io);
}

sclass talkToSubBot_IO extends DialogIO {
  S subBot;
  DialogIO io;
  
  *(S *subBot, DialogIO *io) {}
  
  // delegate all but sendLine
  boolean isStillConnected() { ret io.isStillConnected(); }
  String readLineImpl() { ret io.readLineImpl(); }
  boolean isLocalConnection() { ret io.isLocalConnection(); }
  Socket getSocket() { ret io.getSocket(); }
  public void close() ctex { io.close(); }

  void sendLine(String line) {
    io.sendLine(format3("please forward to bot *: *", subBot, line));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001678
Snippet name: talkToSubBot
Eternal ID of this version: #1001678/4
Text MD5: bc08ca97e6597fdc2cdd90ed47b942a6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-13 22:38:19
Source code size: 787 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 579 / 2507
Version history: 3 change(s)
Referenced in: [show references]