Vizard 7 » Command Index » Vizard modules » viznet » <viznet:client>.send
7.7

<viznet:client>.send

Send an event to the server

<viznet:client>.send(  
id  
*args  
**kw  
)  
id
Event ID
*args
Optional arguments to pass to the server
**kw
Optional keyword arguments to pass to the server

Remarks

This command will send an event to the server. The server can register for the event as a normal callback. The event structure is the same as a network event structure.

Return Value

None

Example

Client:
import viznet

viznet.client.connect('ServerName')

MY_EVENT = viznet.id('MyEvent')

viznet.client.send(MY_EVENT,message='Hello')

Server:
import viznet

viznet.server.start()

MY_EVENT = viznet.id('MyEvent')

def onMyEvent(e):
    print('Received event from',e.sender,'with message:',e.message)
viz.callback(MY_EVENT,onMyEvent)