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