smalltalk
/
osmo-st-mgcp
Archived
1
0
Fork 0

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:
Holger Hans Peter Freyther 2011-07-20 18:31:23 +02:00
parent e84e9ce915
commit 5a3c6bd8b8
1 changed files with 7 additions and 2 deletions

View File

@ -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].