@@ -24,16 +24,16 @@ Stomp.prototype.connect = function(headers) {
24
24
this . stomp_log . debug ( 'Connecting to ' + this . host + ':' + this . port ) ;
25
25
socket = net . createConnection ( this . port , this . host ) ;
26
26
socket . setEncoding ( 'ascii' ) ;
27
- socket . setTimeout ( 0 ) ;
27
+ // socket.setTimeout(0);
28
28
socket . setNoDelay ( true ) ;
29
29
30
30
socket . addListener ( 'connect' , function ( ) {
31
31
self . stomp_log . debug ( 'Connected to socket' ) ;
32
32
self . connected_frame = self . frame_object . stomp_connect ( self . socket ) ;
33
33
} ) ;
34
34
35
- socket . addListener ( 'drain' , function ( ) {
36
-
35
+ socket . addListener ( 'drain' , function ( data ) {
36
+ console . log ( "DRAIN_DATA: " + data ) ;
37
37
} ) ;
38
38
39
39
socket . addListener ( 'data' , function ( data ) {
@@ -110,19 +110,19 @@ Stomp.prototype.ack = function(message_id) {
110
110
} ;
111
111
112
112
Stomp . prototype . send = function ( headers ) {
113
-
113
+ extra = { } ;
114
114
destination = headers [ 'destination' ] ;
115
115
body = headers [ 'body' ] || null ;
116
- headers [ 'want_receipt' ] = true ;
117
-
116
+ extra [ 'want_receipt' ] = true ;
118
117
return this . _send_command ( 'SEND' , headers , body )
119
118
} ;
120
119
121
- Stomp . prototype . _send_command = function ( command , headers , body ) {
120
+ Stomp . prototype . _send_command = function ( command , headers , body , the_rest ) {
122
121
123
122
if ( ! this . utils . really_defined ( headers ) )
124
123
headers = { } ;
125
124
125
+ console . log ( "HEADERS: " + sys . inspect ( headers ) ) ;
126
126
frame_conf = {
127
127
'command' : command ,
128
128
'headers' : headers ,
@@ -132,8 +132,10 @@ Stomp.prototype._send_command = function(command, headers, body) {
132
132
var this_frame = this . connected_frame . build_frame ( frame_conf ) ;
133
133
var reply = this . connected_frame . send_frame ( this_frame ) ;
134
134
135
- if ( 'want_receipt' in headers )
135
+ if ( 'want_receipt' in the_rest ) {
136
+ console . log ( 'want_receipt = true' ) ;
136
137
return reply ;
138
+ }
137
139
138
140
return this_frame ;
139
141
0 commit comments