OrthoDocSoft
Programmer
Folks,
Some of you may remember that I've written my own HL7 "listener" using the winsock object. This works partially, in that I can receive messages (and am doing so), but when I try to send acknowledgement replies, the app that is sending them isn't receiving them. This may be backwards, but I'm calling myself the "server" and the source of the HL7 messages the "client."
He tells me to "listen" on port "1234". I enter this in a textbox, and then fire up this code:
Under the Winsock1.DataArrival, I have this:
DissectMessageForFiling works fine.
SendAcknowledgment essentially looks like this:
But my "client" doesn't receive it.
Can anyone see the problem?
Thanks,
Ortho
"you cain't fix 'stupid'...
Some of you may remember that I've written my own HL7 "listener" using the winsock object. This works partially, in that I can receive messages (and am doing so), but when I try to send acknowledgement replies, the app that is sending them isn't receiving them. This may be backwards, but I'm calling myself the "server" and the source of the HL7 messages the "client."
He tells me to "listen" on port "1234". I enter this in a textbox, and then fire up this code:
Code:
Private Sub cmdStartServer_Click()
On Error GoTo ErrorHandler
If Not IsNumeric(txtLocalPort.Text) Then
txtLocalPort.Text = 0
End If
'If one Copy of Our Application is already running then don't load a new one
If Not App.PrevInstance = True Then
'This can be any Valid Port Number
Winsock1.LocalPort = CLng(txtLocalPort.Text)
'Wait for Clients to Connect with Your Server.
MsgBox "Your selected local port is " & Winsock1.LocalPort
Winsock1.Listen
End If
Exit Sub
Under the Winsock1.DataArrival, I have this:
Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
'MsgBox "data arrived"
Static X As Long
'Count how many times you execute this code.
X = X + 1
If X > 1000000 Then X = 0
lblCount.Caption = "Total messages arrived = " & X
On Error Resume Next
Winsock1.GetData strIncomingMessageG, vbString
Call DissectMessageForFiling(strIncomingMessageG)
Call SendAcknowledgment(strIncomingMessageG)
End Sub
DissectMessageForFiling works fine.
SendAcknowledgment essentially looks like this:
Code:
.....
'build a string
strCompleteACKMessage = strMSHSegment & strMSASegment
Winsock1.SendData strCompleteACKMessage
But my "client" doesn't receive it.
Can anyone see the problem?
Thanks,
Ortho
"you cain't fix 'stupid'...