fixed a bug in socket accept
This commit is contained in:
parent
2b56b1c2b0
commit
2255425b3f
@ -242,7 +242,7 @@ class(#pointer) Y(X)
|
||||
|
||||
class Socket(Object) from 'sck'
|
||||
{
|
||||
var handle := -1.
|
||||
var(#get) handle := -1.
|
||||
var insem, outsem.
|
||||
var(#get,#set) inputAction, outputAction.
|
||||
|
||||
@ -491,9 +491,11 @@ error -> exception
|
||||
|
||||
newaddr := SocketAddress new.
|
||||
newsck := sck accept: newaddr.
|
||||
System log: 'new connection - '; logNl: newaddr.
|
||||
|
||||
System log: 'new connection - '; log: newaddr; log: ' '; log: (newsck handle); logNl.
|
||||
|
||||
newsck inputAction: inact; outputAction: outact.
|
||||
newsck watchInput; watchOuptut.
|
||||
newsck watchInput; watchOutput.
|
||||
].
|
||||
|
||||
[
|
||||
|
@ -210,6 +210,11 @@ TODO: how to pass all variadic arguments to another variadic methods???
|
||||
^self atLevel: System.Log.INFO log: message and: message2.
|
||||
}
|
||||
|
||||
method(#class) logNl
|
||||
{
|
||||
^self atLevel: System.Log.INFO log: S'\n'.
|
||||
}
|
||||
|
||||
method(#class) logNl: message
|
||||
{
|
||||
^self atLevel: System.Log.INFO logNl: message.
|
||||
|
@ -192,7 +192,7 @@ static moo_pfrc_t pf_accept_socket (moo_t* moo, moo_ooi_t nargs)
|
||||
}
|
||||
newsck->handle = MOO_SMOOI_TO_OOP(newfd);
|
||||
|
||||
MOO_STACK_SETRETTORCV (moo, nargs);
|
||||
MOO_STACK_SETRET (moo, nargs, (moo_oop_t)newsck);
|
||||
return MOO_PF_SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user