callagent: Introduce the buffer size of the UDP Datagram
On parse error provide the array as part of the string.
This commit is contained in:
parent
e84e9ce915
commit
5a3c6bd8b8
|
@ -62,7 +62,9 @@ Object subclass: MGCPCallAgentBase [
|
|||
<category: 'handling'>
|
||||
|
||||
self stop.
|
||||
socket := Sockets.DatagramSocket local: addr port: port.
|
||||
socket := (Sockets.DatagramSocket local: addr port: port)
|
||||
bufferSize: 2048;
|
||||
yourself.
|
||||
|
||||
"Receive datagrams from the socket..."
|
||||
rx := [
|
||||
|
@ -152,7 +154,10 @@ MGCPCallAgentBase subclass: MGCPCallAgent [
|
|||
[
|
||||
| res data id trans |
|
||||
data := aData data copyFrom: 1 to: aData size.
|
||||
res := self parser parse: data asString.
|
||||
res := self parser parse: data asString onError: [
|
||||
self error: 'Parse error ', data asByteArray printString.
|
||||
].
|
||||
|
||||
id := res transactionId asInteger.
|
||||
|
||||
trans := sem critical: [transactions copy].
|
||||
|
|
Reference in New Issue