Module bzServer :: Class bzServerConnection
[frames] | no frames]

Class bzServerConnection

source code

A connection with a client

Instance Methods
 
__init__(self, serversocket) source code
Boolean
NewConnection(self)
Check for connection request.
source code
Byte array or None
ReceiveData(self)
Attempts to receive a data packet from a client.
source code
 
SendData(self, data)
Send a raw data packet to client.
source code
 
CloseConnection(self)
Close connection with client.
source code
Boolean
Connected(self)
Gives the connection status of the socket.
source code
Instance Variables
sockaddr. address
.
boolean. connected
.
socket. connection
.
boolean. receive_status
.
socket. serversocket
.
Method Details

NewConnection(self)

source code 
Check for connection request. Socket is supposed not to be in blocking mode.
Returns: Boolean
True if a new connection was received

ReceiveData(self)

source code 
Attempts to receive a data packet from a client. Socket is supposed not to be in blocking mode.
Returns: Byte array or None
received data if attempt succeed.. None otherwise

SendData(self, data)

source code 
Send a raw data packet to client.
Parameters:
  • data (Byte Array.) - the data to send to the client.

Connected(self)

source code 
Gives the connection status of the socket.
Returns: Boolean
a boolean indicating whether socket is connected or not