Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.network.classic

Class EM_SOCKETS


Direct ancestors

EM_SHARED_ERROR_HANDLER

Creation

Features

Invariants

indexing

description

List of all sockets in system.
Use EM_SHARED_SUBSYSTEMS.Network_subsystem to access the only instance of this class.
As normal user of EiffelMedia you don't need to worry about this class. Use the various
socket classes to access network.

date

$Date: 2005/10/26 14:05:23 $

revision

$Revision: 1.19 $

class

EM_SOCKETS

create {EM_NETWORK_SUBSYSTEM}

make

-- Initialise.

feature {EM_TCP_SERVER_SOCKET} -- Implementation

add_server (a_server: EM_TCP_SERVER_SOCKET)

-- Add 'a_server' to server list.

require
port_free: is_port_free (a_server.port)
a_server_not_void: a_server /= Void
add_socket (a_socket: EM_SOCKET)

-- Add a_socket.

require
a_socket_not_void: a_socket /= Void
socket_not_already_added: not has(a_socket)
ensure
socket_added: has(a_socket)
add_transaction (transaction_id: INTEGER; an_inet_address: EM_INET_ADDRESS)

-- Add a transaction

handle_resolve_finished_event (a_transaction_id: INTEGER)

-- Handle resolve trial finished for transaction a_transaction_id.

handle_tcp_accept_event (a_port, a_socket_id: INTEGER)

-- Handle a new connection on 'a_port' with 'a_socket_id'.

handle_tcp_close_event (a_socket_id: INTEGER)

-- Handle TCP close event.

handle_tcp_connect_event (a_socket_id: INTEGER; an_ip_pointer: POINTER)

-- Handle a connection established to a server.

handle_tcp_connect_failed_event (an_error: INTEGER; an_ip_pointer: POINTER)

-- Handle a failed connection attempt.

handle_tcp_receive_event (a_socket_id: INTEGER)

-- Handle a receive event on socket a_socket_id.

handle_udp_receive_event (a_socket_id: INTEGER)

-- Handle a receive event on socket a_socket_id.

handle_udp_send_event (a_socket_id: INTEGER; an_error: INTEGER)

-- Handle an udp send event on socket a_socket_id.

has (a_socket: EM_SOCKET): BOOLEAN

-- Is a_socket present?

is_port_free (a_port: INTEGER): BOOLEAN

-- Is 'a_port' alredy taken?
-- This does not guarantee that 'a_port' is not taken by another program.

next_transaction_id: INTEGER

-- Always a new transaction id

remove_server (a_server: EM_TCP_SERVER_SOCKET)

-- Remove 'a_server' from server list.

require
a_server_not_void: a_server /= Void
ensure
port_freeded: is_port_free (a_server.port)
remove_socket (a_socket: EM_SOCKET)

-- Remove a_socket.

require
a_socket_not_void: a_socket /= Void
has_a_socket: has (a_socket)
ensure
socket_removed: not has (a_socket)
wait_for_connection (a_socket: EM_TCP_CLIENT_SOCKET)

-- Add 'a_socket' to waiting sockets.

require
a_socket_not_void: a_socket /= Void
ensure
socket_added: waiting_sockets.has (a_socket)

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end