I'm new to event processing in vs 2005 - what I'm trying to achieve is
broadly a network simulation of two workstations sending packets to each
other .
I have defined a class 'Workstation' and I was hoping to define events where
in instance A (or workstation) I could raise an event 'Send' (which takes in
the destination instance B (or workstation) and the Packet to send). The
event would then trigger a 'Receive' event in instance B to receive the
packet.
Public Class Workstation
Public Event SendPacket(ByVa l Destination As Workstation, ByVal
SentPacket As Packet)
Public Event ReceivePacket(B yVal Source As Workstation, ByVal
ReceivePacket As Packet)
Public Sub Send(ByVal Destination As Workstation, ByVal SentPacket As
Packet) Handles Me.SendPacket
' send packet to Destination
End Sub
Public Sub Receive(ByVal Source As Workstation, ByVal SentPacket As
Packet) Handles Me.ReceivePacke t
' process packet (pick packet to return)
' send packet to Source
End Sub
What I would like to do is raise the ReceivePacket event in the Destination
Workstation but the editor is not letting me add a statement along the lines
of RaiseEvent Destination.Rec eivePacket()
any help in this area of two instances 'sending messages' between them would
be much appreciated.
TIA
Rob
broadly a network simulation of two workstations sending packets to each
other .
I have defined a class 'Workstation' and I was hoping to define events where
in instance A (or workstation) I could raise an event 'Send' (which takes in
the destination instance B (or workstation) and the Packet to send). The
event would then trigger a 'Receive' event in instance B to receive the
packet.
Public Class Workstation
Public Event SendPacket(ByVa l Destination As Workstation, ByVal
SentPacket As Packet)
Public Event ReceivePacket(B yVal Source As Workstation, ByVal
ReceivePacket As Packet)
Public Sub Send(ByVal Destination As Workstation, ByVal SentPacket As
Packet) Handles Me.SendPacket
' send packet to Destination
End Sub
Public Sub Receive(ByVal Source As Workstation, ByVal SentPacket As
Packet) Handles Me.ReceivePacke t
' process packet (pick packet to return)
' send packet to Source
End Sub
What I would like to do is raise the ReceivePacket event in the Destination
Workstation but the editor is not letting me add a statement along the lines
of RaiseEvent Destination.Rec eivePacket()
any help in this area of two instances 'sending messages' between them would
be much appreciated.
TIA
Rob
Comment