molecule.net

NetSystem

abstract class NetSystem extends AnyRef

This class encapsulates a selector thread that dispatches tasks on sockets in a non-blocking manner. The number of connection that can be handled by a selector is limited to FD_SETSIZE, which is OS specific. See http://www.kegel.com/c10k.html#nb.select.

See also how to change registry settings on windows here: http://www.gridgainsystems.com/wiki/display/GG15UG/Troubleshooting#Troubleshooting-java.net.BindExceptionOnWindows

If you want to handle many connections, either increase the value or create several NetSystems (last solution scales much better in terms of performance).

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NetSystem
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NetSystem()

Abstract Value Members

  1. abstract def launchTcpClient[R](config: TcpClientConfig, process: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[R])(implicit arg0: Message[R]): RIChan[R]

    Connect a TCP client process to a remote server.

    Connect a TCP client process to a remote server.

    R

    the termination result of the client process.

    config

    the client config

    process

    a process that takes network ByteBuffer's as input and output.

    returns

    a tuple with the local address the client is bound to and a RIChan returning the termination result of the client process.

  2. abstract def launchTcpServer(config: TcpServerConfig, handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit]): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    config

    a TCP server config

    handler

    a process type from which new servlets are instantiated.

    returns

    the socket address the server has been bound to.

  3. abstract def platform: Platform

    Return the platform to which this connector is attached to.

    Return the platform to which this connector is attached to.

    All process instances created by launchTcpClient and launchTcpServer are launched over this platform.

    returns

    the underlying platform.

  4. abstract def shutdown(): Unit

    Shutdown.

    Shutdown.

    Close all threading resources allocated by the platform (e.g. the selector thread).

  5. abstract def shutdownNow(): Unit

    Shutdown and close all resources allocated by the platform (e.

    Shutdown and close all resources allocated by the platform (e.g. the selector thread).

  6. abstract def tcpAccept(config: TcpServerConfig, ochan: OChan[Socket[ByteBuffer]]): InetSocketAddress

    Create a TCP server channel.

    Create a TCP server channel.

    config

    a TCP server configuration

    returns

    the local socket address the server has been bound to.

  7. abstract def tcpConnect(config: TcpClientConfig): RIChan[Socket[ByteBuffer]]

    Create a TCP connection to a remote server.

    Create a TCP connection to a remote server.

    config

    the client configuration.

    returns

    a tuple with the local address the client is bound to and a RIChan returning the client socket once it is connected.

  8. abstract def udpBind(local: SocketAddress, remote: SocketAddress, opts: DatagramSocketOption*): Socket[DatagramPacket]

    Create a "connected" UDP socket restricted to a remote peer.

    Create a "connected" UDP socket restricted to a remote peer.

    remote

    the peer address

    opts

    a list of datagram socket options

    returns

    the datagram socket.

  9. abstract def udpBind(address: SocketAddress, opts: DatagramSocketOption*): Socket[DatagramPacket]

    Create a UDP datagram socket.

    Create a UDP datagram socket.

    address

    the local address this socket is bound to

    opts

    a list of datagram socket options

    returns

    the datagram socket.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. def launchTcpClient[R](bindAddr: InetSocketAddress, addr: InetSocketAddress, process: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[R], opts: SocketOption*)(implicit arg0: Message[R]): RIChan[R]

    Connect a TCP client process to a remote server.

    Connect a TCP client process to a remote server.

    R

    the termination result of the client process.

    bindAddr

    the local address the client must be bound to

    addr

    the remote server address

    process

    a process that takes network ByteBuffer's as input and output.

    opts

    socket options that must be applied to the client socket once it is connected

    returns

    a RIChan returning the termination result of the client process.

  15. def launchTcpClient[R](addr: InetSocketAddress, process: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[R], opts: SocketOption*)(implicit arg0: Message[R]): RIChan[R]

    Connect a TCP client process to a remote server.

    Connect a TCP client process to a remote server.

    R

    the termination result of the client process.

    addr

    the remote server address

    process

    a process that takes network ByteBuffer's as input and output.

    opts

    socket options that must be applied to the client socket once it is connected

    returns

    a RIChan returning the termination result of the client process.

  16. def launchTcpClient[R](hostName: String, port: Int, process: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[R], opts: SocketOption*)(implicit arg0: Message[R]): RIChan[R]

    Connect a TCP client process to a remote server.

    Connect a TCP client process to a remote server.

    R

    the termination result of the client process.

    hostName

    the remote server host name

    port

    the remote server port

    process

    a process that takes network ByteBuffer's as input and output.

    returns

    a RIChan returning the termination result of the client process.

  17. def launchTcpServer(addr: InetSocketAddress, handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit], sopts: List[ServerSocketOption], opts: SocketOption*): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    addr

    the local server address on which the server accepts connections

    handler

    a process type from which new servlets are instantiated.

    sopts

    a list of server socket options applied to the server socket.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    the socket address the server has been bound to.

  18. def launchTcpServer(addr: InetSocketAddress, handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit], opts: SocketOption*): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    addr

    the local server address on which the server accepts connections

    handler

    a process type from which new servlets are instantiated.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    the socket address the server has been bound to.

  19. def launchTcpServer(hostName: String, port: Int, handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit], sopts: List[ServerSocketOption], opts: SocketOption*): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    hostName

    the local server interface

    port

    the local server port

    handler

    a process type from which new servlets are instantiated.

    sopts

    a list of server socket options applied to the server socket.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    the socket address the server has been bound to.

  20. def launchTcpServer(hostName: String, port: Int, handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit], opts: SocketOption*): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    hostName

    the local server interface

    port

    the local server port

    handler

    a process type from which new servlets are instantiated.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    the socket address the server has been bound to.

  21. def launchTcpServer(handler: (IChan[ByteBuffer], OChan[ByteBuffer]) ⇒ Process[Unit], opts: SocketOption*): InetSocketAddress

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    Create a TCP server process that spawns a new servlet to handle each new client connection.

    handler

    a process type from which new servlets are instantiated.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    the socket address the server has been bound to.

  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def tcpAccept(config: TcpServerConfig): (InetSocketAddress, IChan[Socket[ByteBuffer]])

    Create a TCP server channel.

    Create a TCP server channel.

    config

    a TCP server configuration

    returns

    a tuple with the local socket address the server has been bound to, and a stream of client sockets filled in progressively each time a new client connection is accepted.

  27. def tcpAccept(hostName: String, port: Int, sopts: List[ServerSocketOption], opts: SocketOption*): IChan[Socket[ByteBuffer]]

    Create a TCP server channel.

    Create a TCP server channel.

    hostName

    the local server interface

    port

    the local server port

    sopts

    a list of server socket options applied to the server socket.

    opts

    a list of socket options applied to each client socket accepted.

    returns

    a stream of client sockets filled in progressively each time a new client connection is accepted.

  28. def tcpAccept(hostName: String, port: Int, opts: SocketOption*): IChan[Socket[ByteBuffer]]

    Create a TCP server channel.

    Create a TCP server channel.

    hostName

    the local server interface

    port

    the local server port

    opts

    a list of socket options applied to each client socket accepted.

    returns

    a stream of client sockets filled in progressively each time a new client connection is accepted.

  29. def tcpAccept(): (InetSocketAddress, IChan[Socket[ByteBuffer]])

    Create a TCP server channel.

    Create a TCP server channel.

    returns

    a tuple with the local socket address the server has been automatically bound to, and a stream of client sockets filled in progressively each time a new client connection is accepted.

  30. def tcpConnect(addr: InetSocketAddress, opts: SocketOption*): RIChan[Socket[ByteBuffer]]

    Create a TCP connection to a remote server.

    Create a TCP connection to a remote server.

    addr

    the remote server address

    opts

    a list of socket options.

    returns

    a RIChan returning the client socket once it is connected.

  31. def tcpConnect(hostName: String, port: Int, opts: SocketOption*): RIChan[Socket[ByteBuffer]]

    Create a TCP connection to a remote server.

    Create a TCP connection to a remote server.

    hostName

    the remote server host name

    port

    the remote server port

    opts

    a list of socket options.

    returns

    a RIChan returning the client socket once it is connected.

  32. def toString(): String

    Definition Classes
    AnyRef → Any
  33. def udpBind(hostName: String, port: Int, opts: DatagramSocketOption*): Socket[DatagramPacket]

    Create a UDP datagram socket.

    Create a UDP datagram socket.

    hostName

    the local name of the interface

    port

    the local port this socket is bound to

    opts

    a list of datagram socket options

    returns

    the datagram socket.

  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped