#1 2016-10-26 21:44:41

mrbar2000
Member
Registered: 2016-10-26
Posts: 2

UDP Sample of SynCRTSocket

I need use UDP communication, but i dont see any sample about your use?

Can anyone here post a simple sample of client and server using this protocol??

Thanks

Offline

#2 2016-10-26 21:47:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 13,504
Website

Re: UDP Sample of SynCRTSocket

Just use TCrtSocket class, and the Open() constructor with explicit UDP mode.

Offline

#3 2016-10-27 12:47:02

mrbar2000
Member
Registered: 2016-10-26
Posts: 2

Re: UDP Sample of SynCRTSocket

Can you post some few lines of code about:

1 - how to Send message strings? this is correct way?

  FClient := TCrtSocket.Open('192.168.1.255', '12001', cslUDP);

  if FClient.SockIn = nil then
    FClient.CreateSockIn;
  if FClient.Sock < 0 then
  begin
    ShowMessage('Socket not found!');
    exit;
  end;
  FClient.SockSend(['Teste aaaaaaaaaaaaaaa']);
  FClient.SockSendFlush;   <<<< I neeed really this??????

lookin on wireshark i see :

41    2.147148    192.168.1.72    192.168.1.255    LLC    65    U F, func=UA; DSAP ISO Network Layer (OSLAN 2) Individual, SSAP 0x64 Response
Why Wireshark shows LLC instead UDP???????

2 - how to Send message steams?

3 - how to treat exceptions?

Last edited by mrbar2000 (2016-10-28 19:02:47)

Offline

Board footer

Powered by FluxBB