SMORES Robot Platform Simulation
Modlab at Penn, ASL at Cornell
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
gztopic_multithreading.GzCommunicator Class Reference

Builds a TCP socket in a spearate thread. More...

Inheritance diagram for gztopic_multithreading.GzCommunicator:

Public Member Functions

def __init__
 Constructor. More...
 
def run
 Creates a thread and starts a socket. More...
 
def WhichCLient
 Find the correct thread and socket. More...
 
def CreatePulisher
 Create a publisher. More...
 
def Close
 Terminate the thread. More...
 
def Publish
 Pblish a message. More...
 

Public Attributes

 MASTER_TCP_IP
 Master ip address.
 
 MASTER_TCP_PORT
 Master port number.
 
 NODE_TCP_IP
 Node ip address.
 
 NODE_TCP_PORT
 Node port number.
 
 TCP_BUFFER_SIZE
 Socket buffer size.
 
 outputs
 List of output sockets.
 
 clientmap
 Dictionary of clients using gztopic string as key.
 
 runserver
 Flag of running server.
 
 server
 A socket that builds communication with simulator plugin.
 

Detailed Description

Builds a TCP socket in a spearate thread.

Constructor & Destructor Documentation

def gztopic_multithreading.GzCommunicator.__init__ (   self,
  masterip = '127.0.0.1',
  masterport = 11345,
  selfport = 11451 
)

Constructor.

Parameters
selfObject pointer
masteripMaster ip address, default is 127.0.0.1
masterportMaster port number, defult 11345
selfportSocket local machine port number

Member Function Documentation

def gztopic_multithreading.GzCommunicator.Close (   self)

Terminate the thread.

Parameters
selfObject pointer
def gztopic_multithreading.GzCommunicator.CreatePulisher (   self,
  topic,
  messagetype 
)

Create a publisher.

Parameters
selfObject pointer
topicGztopic string
messagetypeMessage type string
Returns
A GzPublisher object
def gztopic_multithreading.GzCommunicator.Publish (   self,
  topic,
  msg 
)

Pblish a message.

Parameters
selfObject pointer
topicGztopic string
msgMessage object
def gztopic_multithreading.GzCommunicator.run (   self)

Creates a thread and starts a socket.

Parameters
selfObject pointer
def gztopic_multithreading.GzCommunicator.WhichCLient (   self,
  dic,
  avalue 
)

Find the correct thread and socket.

Parameters
selfObject pointer
dicDictionary that stores all the threads
avalueA socket object
Returns
Gztopic string

The documentation for this class was generated from the following file: