Wal Network Engine

Wal Network Engine is a simple class that manages all network operations. When working with the Wal API you will probably not use the network class but here its just in case it is needed for a particular task.

Here is a simple example of this class:

sock = WalNetwork(TCP, 10, NO) # TCP = 1, for UDP = 2, 10 is timeout, 0 (NO) no ssl, to enable SSL set to 1 (YES)
sock.open_socket()
sock.connect(127.0.0.1, 80)
sock.send_socket_data(mydata) # mydata is a string
sock.close_socket()

Functions List


open_socket

Function Name: def open_socket()
Parameters: Nothing
Return: 1 on success, 0 (zero) on error.
Abstract: Opens a socket.


Home | Top

connect_socket

Function Name: def connect_socket(host, port)
Parameters: host, port
Return: Socket descriptor
Abstract: Connects socket to host and port defined.


Home | Top

close_socket

Function Name: def close_socket()
Parameters: Nothing
Return: Nothing
Abstract: Closes the socket descriptor.


Home | Top

send_socket_data

Function Name: def send_socket_data(data)
Parameters: data string
Return: Sent data size
Abstract: Sends data through the socket.


Home | Top

recv_socket_data

Function Name: def recv_socket_data(size=1000)
Parameters: size (default value is 1000)
Return: String with the received data
Abstract: Receives data through the socket.


Home | Top

socket_makefile

Function Name: def socket_makefile()
Parameters: Nothing
Return:
Abstract:


Home | Top

give_socket

Function Name: def give_socket()
Parameters: Nothing
Return: Socket descriptor
Abstract: Returns the socket descriptor.


set_bind_data

Function Name: def set_bind_data()
Parameters: host, port
Return: Nothing
Abstract: Set local source port.


set_scoket

Function Name: def set_socket()
Parameters: socket
Return: Nothing
Abstract: Set socket descriptor.


Home | Top

Roses Labs Innovations (RL+I)
Roses Labs © 2004