substack/bouncy — Issue #22: Request hang on stream
Author: Contra
Created: 2012-01-23 14:05:16+00:00
State: open

Setting up the stream:

```coffee-script
net = require 'net'
host = 'checkip.dyndns.org'
port = 80
bind = '192.168.1.101'
socket = new net.Socket handle: net._createServerHandle(bind)
stream = socket.connect port, host
```

https://github.com/wearefractal/ipbind is the quick lib I wrote around this. My demo works and connects/binds fine. Is there something I need to do to the stream before I pass it to bouncy?

Code using ipbind:

```coffee-script
stream = net.createConnection port, host, '192.168.1.101'
bounce stream
```

Value of stream before sending:

```javascript
{
_handle:{
writeQueueSize:0,
socket:[
Circular
],
onread:[
Function:onread
]
},
_pendingWriteReqs:0,
_flags:0,
_connectQueueSize:0,
destroyed:false,
bytesRead:0,
bytesWritten:0,
allowHalfOpen:undefined,
_connecting:true,
writable:true
}
```

Value of stream after sending:

```javascript
{
_handle:{
writeQueueSize:0,
socket:[
Circular
],
onread:[
Function:onread
]
},
_pendingWriteReqs:0,
_flags:0,
_connectQueueSize:143,
destroyed:false,
bytesRead:0,
bytesWritten:143,
allowHalfOpen:undefined,
_connecting:true,
writable:true,
_events:{
drain:[
Function:ondrain
],
error:[
[
Function:onerror
],
[
Function:onerror
],
[
Function
]
],
end:[
[
Function:cleanup
],
[
Function:onend
],
[
Function:cleanup
]
],
close:[
[
Function:cleanup
],
[
Function:onclose
],
[
Function:cleanup
]
],
data:[
Function:ondata
]
},
_pipeCount:1,
_connectQueue:[
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
],
[
,
undefined,
undefined
]
]
}
```