Reading TCP packets in Omnis

Jef Leys | Desim jef.leys at desim.be
Wed Feb 28 15:12:00 UTC 2024


Hi,

Some sample code that works.


TCPConnect (FGebouw.GCadisIP,502) Returns socketUit
If flag true

Calculate binBuffer as binfromhex(FullString)
TCPSend (socketUit,binBuffer) Returns return
If flag true

TCPReceive (socketUit,buffer) Returns AntwoordLengte
If flag true

Calculate Antwoord as bintohex(buffer)
End If
End If
End If
TCPClose (socketUit)


Jef Leys

> Op 28 feb. 2024, om 16:09 heeft jim jpcr.com <jim at jpcr.com> het volgende geschreven:
> 
> Hi $List,
> 
> I’m struggling to read incoming TCP packets in Omnis.  I’ve attempted to write code using the various TCP commands, but with no success (and much head banging).
> 
> Does anyone have some sample code they can send me?
> 
> My code needs to listen for a packet on a specific port, and when it comes in it will call a method to write packet data to a database table and then go back to listening.
> 
> Thanks,
> 
> Jim
> 
> 
> 
> --
> Jim Pistrang
> JP Computer Resources
> 413-237-5710
> <https://jpcr.com>
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list