Bob,
This is the basic script:
Dim WithEvents S As CWinSock
Dim WithEvents R As CWinSock
Private Sub S_Data(sData As String, Index As Integer)
R.Host = "127.0.0.1"
R.Port = 26
R.Send sData
End Sub
Private Sub Begin
Set S = New CWinSock
Set R = New CWinSock
S.Listen 23
End Sub
And it must be placed in either a class module or a UserForm, and
BostonWorkStationWinSock must be added to the script's References. You can
start it by running the Begin subroutine. Any oncoming messages will be
processed by S_Data where they are rerouted to the specified Host and Port.
Are there any acknowledgements in this script? If so you'll need to add a
R_Data event to receive the acknowledgement and send it back to S with a
S.Send.
Finally, can more than one message occur at the same time? If so, you'll
need to keep track of the Index associated with each incoming message to
match them up with acknowledgements.
Rich McNeil
Boston Software Systems
866 653 5105
www.bostonworkstation.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bob Plance
Sent: Friday, February 25, 2005 1:29 PM
To: BWS (E-mail)
Subject: [Talk] Having BWS read and send Winsock messages
Hello BWS world,
Does anyone have any BWS code that will read info coming over a winsocket
and resend it.
There is an example in the BWS online Docs about Winsocks but I am having a
problem getting it set up.
Thanks all,
Bob
Bob Plance
Programmer/Analyst
Information Systems
955 Ribaut Road
Beaufort, SC 29902
843-522-5770
fax 843-522-5961
[EMAIL PROTECTED]