Lang.EXPECT(senderPort != 0, "Incoming DCC SEND: Bad port specified: " + StringUtil.toPrintableString(senderPort_s));
long sentFileSize = Util.parseLong(fileSize_s, -1);
Lang.EXPECT(sentFileSize >= 0L, "Incoming DCC SEND: Bad file size: " + StringUtil.toPrintableString(fileSize_s));
IRCUser sender = ircmessage.getSender();
//
final DccReceiver dr = irclistener.onCreateDccReceiver(sender, ircmessage.getMiddlePart(0), suggestedFileName, sentFileSize, inetaddress, senderPort);
if (dr == null) {
IRCProtocol.dbg("onCreateDccReceiver() returned null, DCC SEND not handled or is ignored: skipped.");
return;
} else {
Thread thread = new Thread("DCCRECV of " + suggestedFileName + " from " + sender.getActiveNick() + "/" + inetaddress) {
public void run() {
try {
IRCProtocol.dbg("Thread " + Thread.currentThread().getName() + " spawned.");
dr.onFileReceiveStart();
}
catch (Throwable tr) {
dr.unhandledException(tr);
}
}
};
thread.start();
return;