Left = 8
Top = 72
Bitmap = {
- 494C01012F003100040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
+ 494C01012F003100040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
000000000000360000002800000040000000D0000000010020000000000000D0
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
C001FFFFFC018000C001F7FFFC010000C001F7FFFC010000C001F3CF00010000
C001F18F00010001C001F89F00010003C001F83F00010007C001F87F00030007
C001F03F00070007C001F11F000F0007C001FF8F00FF0007C003FFC701FF800F
- C007FFFF03FFF8FFC00FFFFFFFFFFFFF}
+ C007FFFF03FFF8FFC00FFFFFFFFFFFFF00000000000000000000000000000000
+ 000000000000}
end
object mnPopupConst: TPopupMenu
Images = imgIcon
DebugMode = False
ProxyMode = False
OnConnect = IdSLPP20Connect
+ OnConnectFailed = IdSLPP20ConnectFailed
OnDisconnect = Slpp20Disconnect
OnSLPPEvent = Slpp20SlppEvent
Left = 392
Left = 424
Top = 104
end
- object AntiFreeze: TIdAntiFreeze
- OnlyWhenIdle = False
- Left = 392
- Top = 104
- end
end
ScriptConsts, DateUtils, BottleChainRule, BottleChainEvent,
SakuraSeekerInstance, HEditor, HTSearch, heClasses, heFountain,
SakuraScriptFountain, SppList, SurfacePreview, XDOM_2_3_J3, SsPlayTime,
- RegexUtils, StrReplace, StrReplaceDialog, IdAntiFreezeBase, IdAntiFreeze;
+ RegexUtils, StrReplace, StrReplaceDialog, IdAntiFreezeBase;
type
TSurfacePreviewType = (spHint, spEditor);
mnUndo: TMenuItem;
mnRedo: TMenuItem;
N9: TMenuItem;
- AntiFreeze: TIdAntiFreeze;
procedure actConfirmExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure memScriptSelectionChange(Sender: TObject; Selected: Boolean);
procedure actUndoExecute(Sender: TObject);
procedure actRedoExecute(Sender: TObject);
+ procedure IdSLPP20ConnectFailed(Sender: TObject);
private
FSleeping: boolean; // \94z\91\97\83X\83\8a\81[\83v\92\86\82©\82Ç\82¤\82©
FStatusText: String;
end;
IdSlpp20.LUID := Pref.LUID;
self.Cursor := crHourGlass;
- try
- if IdSlpp20.Connected then IdSlpp20.Disconnect;
- if Pref.UseHttpProxy then begin
- IdSlpp20.Host := Pref.ProxyAddress;
- IdSlpp20.Port := Pref.ProxyPort;
- IdSlpp20.ProxyMode := true;
- end else begin
- IdSlpp20.Host := Pref.BottleServer;
- IdSlpp20.Port := Pref.BottleServerPort;
- IdSlpp20.ProxyMode := false;
- end;
- IdSlpp20.Connect;
- except
- on EIdException do begin
- Added := false;
- if FBeginConnectFailCount = 0 then begin
- Inc(FBeginConnectFailCount);
- Beep;
- if Pref.UseHttpProxy then
- ShowMessage('HTTP Proxy\82ð\92Ê\82¶\82ÄSSTP Bottle\83T\81[\83o\82É\90Ú\91±\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B'#13#10 +
- '\83l\83b\83g\83\8f\81[\83N\82Ì\8fó\91Ô\81EProxy\82Ì\8fó\91Ô\82ð\8am\94F\82µ\82Ä\82\82¾\82³\82¢\81B'#13#10 +
- '\82 \82é\82¢\82Í\83T\81[\83o\82ª\83_\83E\83\93\82µ\82Ä\82¢\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B')
- else
- ShowMessage('SSTP Bottle\83T\81[\83o\82É\90Ú\91±\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B'#13#10 +
- '\83l\83b\83g\83\8f\81[\83N\82É\8cq\82ª\82Á\82Ä\82¢\82é\82©\8am\94F\82µ\82Ä\82\82¾\82³\82¢\81B'#13#10 +
- '\82 \82é\82¢\82Í\83T\81[\83o\82ª\83_\83E\83\93\82µ\82Ä\82¢\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B');
- end else
- Inc(FBeginConnectFailCount);
- end;
+ if IdSlpp20.Connected then IdSlpp20.Disconnect;
+ if Pref.UseHttpProxy then begin
+ IdSlpp20.Host := Pref.ProxyAddress;
+ IdSlpp20.Port := Pref.ProxyPort;
+ IdSlpp20.ProxyMode := true;
+ end else begin
+ IdSlpp20.Host := Pref.BottleServer;
+ IdSlpp20.Port := Pref.BottleServerPort;
+ IdSlpp20.ProxyMode := false;
end;
+ IdSlpp20.ConnectServer;
self.Cursor := crDefault;
end;
inherited;
end;
+procedure TfrmSender.IdSLPP20ConnectFailed(Sender: TObject);
+begin
+ Added := false;
+ if FBeginConnectFailCount = 0 then
+ begin
+ Beep;
+ if Pref.UseHttpProxy then
+ ShowMessage('HTTP Proxy\82ð\92Ê\82¶\82ÄSSTP Bottle\83T\81[\83o\82É\90Ú\91±\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B'#13#10 +
+ '\83l\83b\83g\83\8f\81[\83N\82Ì\8fó\91Ô\81EProxy\82Ì\8fó\91Ô\82ð\8am\94F\82µ\82Ä\82\82¾\82³\82¢\81B'#13#10 +
+ '\82 \82é\82¢\82Í\83T\81[\83o\82ª\83_\83E\83\93\82µ\82Ä\82¢\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B')
+ else
+ ShowMessage('SSTP Bottle\83T\81[\83o\82É\90Ú\91±\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B'#13#10 +
+ '\83l\83b\83g\83\8f\81[\83N\82É\8cq\82ª\82Á\82Ä\82¢\82é\82©\8am\94F\82µ\82Ä\82\82¾\82³\82¢\81B'#13#10 +
+ '\82 \82é\82¢\82Í\83T\81[\83o\82ª\83_\83E\83\93\82µ\82Ä\82¢\82é\89Â\94\\90«\82ª\82 \82è\82Ü\82·\81B');
+ end;
+ Inc(FBeginConnectFailCount);
+end;
+
end.
FOnConnect: TNotifyEvent;
FOnDisconnect: TNotifyEvent;
FLastReadTime: Int64;
+ FTimeout: Integer;
+ FOnConnectFailed: TNotifyEvent;
procedure SetDebugMode(const Value: boolean);
procedure SetLUID(const Value: String);
procedure SetOnSlppEvent(const Value: TIdSlppEvent);
procedure SetOnDisconnect(const Value: TNotifyEvent);
function GetLastReadTimeInterval: integer;
procedure SetLastReadTime(const Value: Int64);
+ procedure SetOnConnectFailed(const Value: TNotifyEvent);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect(const ATimeout: Integer = IdTimeoutDefault); override;
+ procedure ConnectServer(const ATimeout: Integer = IdTimeoutDefault);
procedure Disconnect; override;
procedure DoOnSlppEvent;
+ procedure DoOnConnect;
+ procedure DoOnConnectFailed;
property SLPP20ReadThread: TIdSLPP20ReadThread read FSLPPThread;
property LastReadTime: Int64 read FLastReadTime write SetLastReadTime;
property LastReadTimeInterval: integer read GetLastReadTimeInterval;
property DebugMode: boolean read FDebugMode write SetDebugMode;
property ProxyMode: boolean read FProxyMode write SetProxyMode;
property OnConnect: TNotifyEvent read FOnConnect write SetOnConnect;
+ property OnConnectFailed: TNotifyEvent read FOnConnectFailed write SetOnConnectFailed;
property OnDisconnect: TNotifyEvent read FOnDisconnect write SetOnDisconnect;
property OnSLPPEvent: TIdSlppEvent read FOnSlppEvent write SetOnSlppEvent;
{ProxyMode = true\82Ì\82Æ\82«\82Í\81AHost, Port\82É\83v\83\8d\83L\83V\96¼\82ð}
procedure TIdSLPP20.Connect(const ATimeout: Integer);
begin
inherited Connect(ATimeout);
+end;
+
+procedure TIdSLPP20.ConnectServer;
+begin
try
- if Assigned(FOnConnect) then begin
- OnConnect(self);
- end;
- // create the reading thread and assign the current Telnet object to it
+ FTimeout := ATimeout;
FSLPPThread := TIdSLPP20ReadThread.Create(self);
except on E: EIdSocketError do
raise EIdSlppClientConnectError.Create('Connection Failed');
if Assigned(FSLPPThread) then begin
FSLPPThread.Terminate;
// FSLPPThread.WaitFor;
+ FSLPPThread := nil;
end;
if Assigned(FOnDisconnect) then begin
OnDisconnect(self);
end;
end;
+procedure TIdSLPP20.DoOnConnect;
+begin
+ if Assigned(FOnConnect) then
+ FOnConnect(self);
+end;
+
+procedure TIdSLPP20.DoOnConnectFailed;
+begin
+ if Assigned(FOnConnectFailed) then
+ FOnConnectFailed(self);
+end;
+
procedure TIdSLPP20.DoOnSlppEvent;
begin
try
FOnSlppEvent(self, FSLPPThread.FEvent, FSLPPThread.FParam);
except
- ShowMessage('Exception occured in OnSlppEvent');
+ on E: Exception do
+ ShowMessage('Exception occured in OnSlppEvent: '#13#10 + E.Message);
end;
end;
FOnConnect := Value;
end;
+procedure TIdSLPP20.SetOnConnectFailed(const Value: TNotifyEvent);
+begin
+ FOnConnectFailed := Value;
+end;
+
procedure TIdSLPP20.SetOnDisconnect(const Value: TNotifyEvent);
begin
FOnDisconnect := Value;
constructor TIdSLPP20ReadThread.Create(AClient: TIdSLPP20);
begin
- inherited Create(false);
+ inherited Create(true);
FClient := AClient;
FreeOnTerminate := true;
+ Resume;
end;
procedure TIdSLPP20ReadThread.Execute;
var Line: String;
begin
+ try
+ FClient.Connect(FClient.FTimeout);
+ if Assigned(FClient.OnConnect) then begin
+ Synchronize(FClient.DoOnConnect);
+ end;
+ except
+ Synchronize(FClient.DoOnConnectFailed);
+ Exit;
+ end;
+
FRecvData := TStringList.Create;
FReceivedLog := TStringList.Create;
if FClient.ProxyMode then begin