0

Following code below should reconnect my audio server if it was found to be disconnected now all is good the timer event is called and the system message shows its reconnecting however it seams the connect procedure fails to be called as it dont reconnect.

procedure TGizletView.AudioConTimerTimer(Sender: TObject);
begin
  AudioConTimer.Enabled := False;
  AddSystemMessage('Reconnecting to MCP...', SFontDialog);
  ConnectToAudioServer('ADDR', 'PORT', 'PASSWORD');
end;

code below is were it fails.

procedure TGizletView.ConnectToAudioServer(const IP, Port, Key: String);
begin
  AudioClient.srvMasterkey := Key;
  AudioClient.connect(UserID, RoomID, IP, Port);
end;

it seams it not able to be called yet if I do same code as a tbutton it would work fine if pressed, anyone got anyone got ideas why would this be happening??

Thanks

2
Contributors
1
Reply
9
Views
2 Years
Discussion Span
Last Post by SalmiSoft
0

I don't see anything wrong with this, assuming "'ADDR', 'PORT', 'PASSWORD'" is just dummy data to avoid publishing your real data, and that you enable the timer somewhere.

I suggest you put a break point on the first line of both of these routines and step through the code line-by-line in the debugger. Examine the variable values at each step to be sure you have valid data. Let us know what you find; I am curious.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.