Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: IDUDPSERVER Threaded Event on android


This question is answered.


Permlink Replies: 2 - Last Post: Dec 19, 2017 1:15 PM Last Post By: Remy Lebeau (Te...
madammar ellias

Posts: 111
Registered: 8/17/17
IDUDPSERVER Threaded Event on android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2017 2:26 AM
i have set indy udpserver threaded event to True on android device but the read event does not seem to work here how it looks like
procedure TForm1.udpreciverUDPRead(AThread: TIdUDPListenerThread;
  const AData: TIdBytes; ABinding: TIdSocketHandle);
begin
TThread.Synchronize(nil,
procedure
begin
 
memo1.lines.add(intTostr(Length(AData)));
end);
 
end;


i have tested on win32 it work but on android it doesn't what cloud be the issue ?
madammar ellias

Posts: 111
Registered: 8/17/17
Re: IDUDPSERVER Threaded Event on android  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2017 7:18 AM   in response to: madammar ellias in response to: madammar ellias
madammar ellias wrote:
i have set indy udpserver threaded event to True on android device but the read event does not seem to work here how it looks like
procedure TForm1.udpreciverUDPRead(AThread: TIdUDPListenerThread;
  const AData: TIdBytes; ABinding: TIdSocketHandle);
begin
TThread.Synchronize(nil,
procedure
begin
 
memo1.lines.add(intTostr(Length(AData)));
end);
 
end;


i have tested on win32 it work but on android it doesn't what cloud be the issue ?

solved used check synchronize .
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: IDUDPSERVER Threaded Event on android
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 19, 2017 1:15 PM   in response to: madammar ellias in response to: madammar ellias
madammar ellias wrote:

i have set indy udpserver threaded event to True on android device
but the read event does not seem to work here

The only way that would happen is if your app's main UI thread is not
calling CheckSynchronize() periodically. It should be under normal
conditions.

how it looks like

FYI, there is no point in setting ThreadedEvent=True and then
Synchronize()'ing the entire handler. Instead, set ThreadedEvent=False
and don't call Synchronize() at all (TIdUDPServer calls it internally
for you).

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02