EventScript Help Needed

I want to use an eventscript and send the jobID and a string to a c# server via a socket. Anyone ever done this before with deadline?

###############################################################

Imports

###############################################################
from System.Diagnostics import *
from System.IO import *
from System import TimeSpan

from Deadline.Events import *
from Deadline.Scripting import *

import re, sys, os
import socket

###############################################################

This is the function called by Deadline to get an instance of the Salt event listener.

###############################################################
def GetDeadlineEventListener():
return MyEventListener()

def CleanupDeadlineEventListener( eventListener ):
eventListener.Cleanup()

###############################################################

The Salt event listener class.

###############################################################
class MynEventListener (DeadlineEventListener):
def init( self ):
# Set up the event callbacks here
self.OnJobSubmittedCallback += self.OnJobSubmitted
self.OnJobStartedCallback += self.OnJobStarted
self.OnJobErrorCallback += self.OnJobError
self.OnJobFailedCallback += self.OnJobFailed
self.OnJobFinishedCallback += self.OnJobFinished

def Cleanup( self ):
    del self.OnJobSubmittedCallback
    del self.OnJobFinishedCallback

def OnJobSubmitted( self, job ):
    # TODO: Connect to pipeline site to notify it that a job has been submitted
    # for a particular shot or task.
	if Jobs.Job.JobUserName != "developer"
		return None
		else:
			##send jobID and status "submitted" to server@socket 
			## Connect to server and send data
			

def OnJobStarted( self, job ):
	# TODO: Connect to pipeline site to notify it that a job has been started
	# for aparticular shot or task.
	pass

def OnJobError( self, job ):
	# TODO: Connect to pipeline site to notify it that a job failed
	# for a particular shot or task.
	pass

def OnJobFailed( self, job ):
	# TODO: Connect to pipeline site to notify it that a job failed
	# for a particular shot or task.
	pass

def OnJobFinished( self, job ):
    # TODO: Connect to pipeline site to notify it that the job for a particular
    # shot or task is complete.
    pass

This should work fine. You could import System.Net.Sockets from .NET and use that to talk to your service. Plenty of examples for .NET sockets can be found with a search. Have you given this a try?

Jon implemented some fun stuff in our MicroStation submitter. Looked at it, and we’re using a home-grown wire protocol. It’s not overly complicated, but more than you’ll want to play with.

Can you give us a bit more info? Do you need some advice on socket programming, or how to have it set up within Deadline’s plugin scripting?