SocketCore

From REALbasicWiki

Jump to: navigation, search
Overall article skill Skill ranges from beginner (green) to expert (red)
SocketCore class
Available on Mac OS X Linux Windows
General
Superclass Object
Interfaces None
Constants
  • NoError = 0
  • OpenDriverError = 100
  • LostConnection = 102
  • NameResolutionError = 103
  • AddressInUseError = 105
  • InvalidStateError = 106
  • InvalidPortError = 107
  • OutOfMemoryError = 108
Methods
  • Sub Close()
  • Sub Connect()
  • Sub Poll()
  • Sub Purge()
Properties
Events
  • Sub DataAvailable()
  • Sub Error()
  • Sub SendComplete(userAborted as Boolean)

NOTE: You can get descriptions of the items above from the REALbasic documentation.


SocketCore is the base class for other socket classes including TCPSocket and UDPSocket. You should not create an instance of SocketCore. The compiler allows, but bad things will happen.

[edit] More on Methods

[edit] Close

The Close method does not invoke the Error event handler. This behavior differs from TCPSocket.Disconnect, which does invoke the TCPSocket.Error event handler.

[edit] Handle

On Mac OS X, the Handle integer value corresponds to the UNIX-level socket descriptor which you can use with getsockname or getsockopt (both declared in System.framework) , for example. If you ever need to work with CFSocket instead, pass the Handle value from REALbasic to the CFSocketCreateWithNative system function.

Personal tools
related