|
@ -75,13 +75,15 @@ Connection::Initialize (v8::Handle<v8::Object> target) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Handle<Value> |
|
|
Handle<Value> |
|
|
Connection::ReadyStateGetter (Local<String> _, const AccessorInfo& info) |
|
|
Connection::ReadyStateGetter (Local<String> property, const AccessorInfo& info) |
|
|
{ |
|
|
{ |
|
|
Connection *connection = NODE_UNWRAP(Connection, info.This()); |
|
|
Connection *connection = NODE_UNWRAP(Connection, info.This()); |
|
|
if (!connection) return Handle<Value>(); |
|
|
if (!connection) return Handle<Value>(); |
|
|
|
|
|
|
|
|
HandleScope scope; |
|
|
HandleScope scope; |
|
|
|
|
|
|
|
|
|
|
|
assert(property == READY_STATE_SYMBOL); |
|
|
|
|
|
|
|
|
switch(connection->ReadyState()) { |
|
|
switch(connection->ReadyState()) { |
|
|
case OPEN: return scope.Close(OPEN_SYMBOL); |
|
|
case OPEN: return scope.Close(OPEN_SYMBOL); |
|
|
case OPENING: return scope.Close(OPENING_SYMBOL); |
|
|
case OPENING: return scope.Close(OPENING_SYMBOL); |
|
@ -131,12 +133,6 @@ Connection::~Connection () |
|
|
ForceClose(); |
|
|
ForceClose(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void |
|
|
|
|
|
Connection::SetServer (Handle<Object> server_handle) |
|
|
|
|
|
{ |
|
|
|
|
|
HandleScope scope; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Handle<Value> |
|
|
Handle<Value> |
|
|
Connection::New (const Arguments& args) |
|
|
Connection::New (const Arguments& args) |
|
|
{ |
|
|
{ |
|
@ -557,6 +553,8 @@ Server::OnConnection (struct sockaddr *addr, socklen_t len) |
|
|
{ |
|
|
{ |
|
|
HandleScope scope; |
|
|
HandleScope scope; |
|
|
|
|
|
|
|
|
|
|
|
assert(len > 0); // just to get rid of the warning.
|
|
|
|
|
|
|
|
|
TryCatch try_catch; |
|
|
TryCatch try_catch; |
|
|
|
|
|
|
|
|
Local<Object> js_connection = |
|
|
Local<Object> js_connection = |
|
|