This project is read-only.

Socket

The socket type allows Mirelle programs to interact with the network.

Methods

  • void construct: create a new socket
  • void connect(string addr, int port): connect to a remote machine on given address and port
  • void bind(int port): bind the socket to a port
  • void listen: start listening on a port (the execution pauses until something is received)
  • bool can_read: checks if you can read from socket
  • bool can_write: checks if you can write to socket
  • string read: read data from socket as a string
  • int[] read_bytes: read data from socket as an array of bytes (stored in integers)
  • void write(string data): write data to socket as string
  • void write_bytes(int[] data): write data to socket as an array of bytes (stored in integers)
  • void close: closes the socket for all eternity
  • void refresh: allows socket reuse after a connection has finished

Last edited Mar 17, 2011 at 11:35 PM by impworks, version 1

Comments

No comments yet.