Home | All Classes | Grouped Classes | Index | Search

Class CL_Socket

This is the lowlevel raw socket interface in clanlib. More...

Derived from: none
Derived by: none
Group: Network (Sockets)

#include <ClanLib/network.h>

Construction:

CL_Socket

Constructs a null socket.

Attributes:

input

Input source that operates on the socket.

output

Output source that operates on the socket.

get_socket

Returns the raw socket handle (for use with the lowlevel socket functions).

get_max_msg_size

Returns the maximum size of a message for message-oriented socket types (CL_Socket::udp).

get_read_trigger

Returns an event trigger that triggers when socket has data ready to be read.

get_write_trigger

Returns an event trigger that triggers when socket is ready for additional data.

get_exception_trigger

Returns an event trigger that triggers when an exception occurs on the socket.

get_source_address

Returns the socket name.

get_dest_address

Returns the name of the destination socket we are connected to.

get_broadcast_addresses

Returns the list of broadcast addresses available to this socket. Works for UDP on IPv4 only.

Operations:

operator =

Copy operator.

set_nonblocking

Sets the socket blocking mode.

set_nodelay

If enabled, don't delay send to coalesce packets.

set_broadcasting

If enabled, do broadcasting. Works for UDP on IPv4 only

send

Writes data to socket. Returns the amount that was written.

push

Push data back into the received data buffer.

recv

Reads data from the socket. Returns the amount that was read.

connect

Initiate a connection on the socket.

shutdown

Shut down part of full-duplex connection.

bind

Bind the socket to the specified address.

listen

Listen for connections on the socket.

accept

Accept a connection on the socket.

Signals:

sig_read_triggered

This signal is invoked when the socket has data ready to be read.

sig_write_triggered

This signal is invoked when the socket has data ready to be written.

sig_exception_triggered

This signal is invoked when an exception occurred on the socket.

sig_disconnected

This signal is invoked when the remote side drops the connection, either through timeout or explicit shutdown

Implementation:

impl

proto

Detailed description:

!group=Network/Sockets! !header=network.h!


Questions or comments, write to the
ClanLib mailing list.