UDP Adapter not working
Hello
I am trying to work with UDP Connection/Adapter and I get this error.
Here is the method
{
Parameter ADAPTER = "EnsLib.UDP.OutboundAdapter";
Property Adapter As EnsLib.UDP.OutboundAdapter;
Method SendData(pInput As Ens.Request, Output pOutput As Ens.Response) As %Status
{
Try {
Set status=$$$OK
Set pOutput=##class(Ens.Response).%New()
Set stream = ##class(%Stream.GlobalCharacter).%New()
Do stream.Write("This is some text")
$$$LOGINFO(stream.Read())
Do stream.Rewind()
Set status = ..Adapter.SendStream(stream)
}
Catch exception {
Set status=exception.AsStatus()
}
Return status
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="Ens.Request">
<Method>SendData</Method>
</MapItem>
</MapItems>
}
}
I have tried with ##class(%Net.UDP).%New() and it is working.
Does anyone have an idea of why it is not working or some example of a functionnal method, please ?
Thanks in advance
Corentin
PS : For those who don't want explore the code to find the line where it generate an error :
Set tStatus = 1
Try {
Do pBuffer.Rewind()
Use pDevice Do pBuffer.OutputToDevice()
Use pDevice Write !
}
Catch eSend {
Set tStatus = eSend.AsStatus()
}
Quit tStatus }
Comments
PPS : In order to test it, we can execute the following code in the terminal
Set sobj = ##class(%Net.UDP).%New(3001,"127.0.0.1")
zwrite sobj.Recv()Update :
I have created a ticket to WRC. Indeed, there is a bug, the adapter is not working.
We have to use the ##class(%Net.UDP).%New()
Corentin