Sockets


Functions

int ix_make_udp_socket (int port)
int ix_make_tcp_socket (int port)
int ix_make_tcp_dyn_socket (int *port)
int ix_connect_remote (int socket, struct in_addr *addr, unsigned short port)
int ix_socket_join_multicast (int socket, struct in_addr addr)

Detailed Description

This module describe some utilities methods to deal with sockets.

Function Documentation

int ix_connect_remote ( int  socket,
struct in_addr *  addr,
unsigned short  port 
)

connect to remote addr and port in host order via socket (which is usually made with ix_make_..._socket with no special port given)

Parameters:
socket local socket to connect
addr remote address you want to connect to socket (in case of udp socket this may be the default address to send datagramms)
port remote port (net-order) you want to connect to socket (in case of udp socket this may be the default port to send datagramms)
Returns:
  • 0: OK
  • <0: error

int ix_make_tcp_dyn_socket ( int *  port  ) 

returns tcp socket bind to a dynamic port

Parameters:
port pointer where to store port in hostorder
Returns:
  • socketfd
  • <0: error

int ix_make_tcp_socket ( int  port  ) 

returns tcp socket bind to port

Parameters:
port port in hostorder. If value is 0 some arbitrary port is used (this is usually used for outgoing connections).
Returns:
  • socketfd
  • <0: error

int ix_make_udp_socket ( int  port  ) 

returns udp socket bind to port

Parameters:
port port in hostorder. If value is 0 some arbitrary port is used (this is usually used for outgoing connections).
Returns:
  • socketfd
  • <0: error

int ix_socket_join_multicast ( int  socket,
struct in_addr  addr 
)

join a udp/ip socket to a multicast group

Parameters:
socket to join
multicast_addr multicast group
Returns:
  • 0: OK
  • <0: error


Generated on 4 Mar 2014 for ixtools by  doxygen 1.4.7