Skip to content

Network Library API

Brom Bresenham edited this page Apr 7, 2024 · 13 revisions

Sockets.rogue

class BasicServerSocket

extends ServerSocket

Properties

Name Type Description
is_listening Logical
port Int32
socket_id Int

Methods

Signature Return Type Description
init( port:Int32 )
accept_connection() BasicSocket Returns null if no connections are being attempted.
close()
is_listening() Logical
on_cleanup()
port() Int32
socket_id() Int32

class BasicSocket

extends Socket

Properties

Name Type Description
port Int32
printer PrintWriter
reader BasicSocketReader
remote_address String
remote_ip String
socket_id Int
state Int32
writer BasicSocketWriter

Methods

Signature Return Type Description
init( remote_address:String, port:Int32 ) $if (USING_THREADS)
      Thread( this=>handle_connection )
$else
init( socket_id:Int ) Internal use - used by BasicServerSocket
close()
handle_connection()
is_closed() Logical
is_connected() Logical
is_connecting() Logical
on_cleanup()
output() PrintWriter
reader() Reader<<Byte>>
remote_ip() String
socket_id() Int32
writer() Writer<<Byte>>

class BasicSocketReader

extends Object

incorporates Reader<<$DataType>>

Properties

Name Type Description
buffer_count Int32
buffer_pos Int32
position Int
socket BasicSocket

Methods

Signature Return Type Description
init( socket:BasicSocket )
close()
has_another() Logical
on_end_use()
on_use() BasicSocketReader
peek() Byte
position() Int
read() Byte
read( buffer:Byte[], limit:Int ) Int
reset()
seek( pos:Int )
seek( pos:Int32 )
skip( n:Int )
to<<Byte[]>>() Byte[]
to<<String>>() String

class BasicSocketWriter

extends Object

incorporates Writer<<$DataType>>

Properties

Name Type Description
position Int
socket BasicSocket
write_buffer Byte[]

Methods

Signature Return Type Description
init( socket:BasicSocket )
close()
flush()
on_use() BasicSocketWriter
on_end_use( err:Exception ) Exception
position() Int
reset()
seek_end()
seek( pos:Int )
seek( pos:Int32 )
skip( n:Int )
skip( n:Int32 )
write( list:Byte[] )
write( value:Byte )

class ServerSocket

extends Object

Description

Abstract base class of BasicServerSocket and SecureServerSocket

Global Methods

Signature Return Type Description
create( port:Int32 ) ServerSocket

Methods

Signature Return Type Description
accept_connection() Socket
close()
is_listening() Logical
port() Int32
socket_id() Int32

class Socket

extends Object

Description

Abstract base class of BasicSocket and SecureSocket

Global Methods

Signature Return Type Description
create( remote_address:String, port:Int32 ) Socket
create( socket_id:Int32 ) Socket Internal use only - used by BasicServerSocket.

Methods

Signature Return Type Description
close()
is_closed() Logical
is_connected() Logical
is_connecting() Logical
output() PrintWriter
reader() Reader<<Byte>>
remote_ip() String
socket_id() Int32
writer() Writer<<Byte>>
Clone this wiki locally