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);
  AudioConTimer.Enabled := False;
  AddSystemMessage('Reconnecting to MCP...', SFontDialog);
  ConnectToAudioServer('ADDR', 'PORT', 'PASSWORD');

code below is were it fails.

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

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??


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.