Platforms to show: All Mac Windows Linux Cross-Platform
PacketSocketMBS class
Super class: TCPSocket
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Network | MBS Network Plugin | 8.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A packet is made like this:
+0: Size of data block
+4: 4 byte code string
+8: 4 byte for ID
+12: variable data.
The numbers are send in low endian format so this is crossplatform.
This socket subclass can be easily made in Xojo code itself. I did it for several of my applications, so if you like it decide between making it yourself or using this one which may even be faster, because it is written in C?
This class is only available in RB 4.0 or newer, because it crashes on RB 3.5.
As the strings are transferred as binary data you need to take care that you send text e.g. as UTF8 and restore this encoding setting on receiving.
Subclass of the TCPSocket class.
- event ReceivedPacket(data as string,code as string,ID as Integer)
- 3 methods
- method SendPacket(data as string)
- method SendPacket(data as string,code as string)
- method SendPacket(data as string,code as string,ID as Integer)
Super class TCPSocket
This class has no sub classes.
Some examples using this class:
Blog Entries
- MBS Xojo Plugins, version 22.5pr4
- MBS Xojo Plugins, version 21.5pr1
- MonkeyBread Software Releases the MBS Plugins 8.1
Release notes
- Version 22.5
- Fixed PacketSocketMBS to work in console apps.
- Version 21.5
- Fixed socket methods for PacketSocketMBS class.
The items on this page are in the following plugins: MBS Network Plugin.
OverlayMBS - PaletteCalculatorMBS