added just a few lines of code
This commit is contained in:
		| @ -37,6 +37,29 @@ class Collection(Object) | ||||
| 		self do: [ :el | if (block value: el) { ^el } ]. | ||||
| 		^exception_block value. | ||||
| 	} | ||||
|  | ||||
| (* ------------------- TODO ------------------------------- | ||||
| 	method add: object | ||||
| 	{ | ||||
| 		self subclassResponsibility: #add:. | ||||
| 	} | ||||
| 	 | ||||
| 	method select: condition_block | ||||
| 	{ | ||||
| 		| coll | | ||||
| 		coll := self class new: self basicSize. | ||||
| 		self do: [ :el | if (condition_block value: el) { coll add: el } ]. | ||||
| 		^coll | ||||
| 	} | ||||
|  | ||||
| 	method reject: condition_block | ||||
| 	{ | ||||
| 		| coll | | ||||
| 		coll := self class new: self basicSize. | ||||
| 		self do: [ :el | if (condition_block value: el) { } else { coll add: el } ]. | ||||
| 		^coll | ||||
| 	} | ||||
| *) | ||||
| } | ||||
|  | ||||
| ## ------------------------------------------------------------------------------- | ||||
|  | ||||
| @ -1,9 +1,16 @@ | ||||
| ###include 'Moo.moo'. | ||||
| #include 'Socket.moo'. | ||||
|  | ||||
|  | ||||
| class HttpServerSocket(ServerSocket) | ||||
| { | ||||
| 	method(#class) initialize | ||||
| 	{ | ||||
| 		self onEvent: #accepted do: [ | ||||
| 		 | ||||
| 		]. | ||||
| 		 | ||||
| 		###self addEventListener: self. | ||||
| 	} | ||||
| } | ||||
|  | ||||
| class HttpServer(Object) | ||||
| @ -22,14 +29,14 @@ class HttpServer(Object) | ||||
| 		if (laddr class == Array) | ||||
| 		{ | ||||
| 			laddr do: [:addr | | ||||
| 				sck := ServerSocket family: (addr family) type: Socket.Type.STREAM. | ||||
| 				sck := HttpServerSocket family: (addr family) type: Socket.Type.STREAM. | ||||
| 				self.server_sockets addLast: sck. | ||||
| 				sck bind: addr. | ||||
| 			]. | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			sck := ServerSocket family: (laddr family) type: Socket.Type.STREAM. | ||||
| 			sck := HttpServerSocket family: (laddr family) type: Socket.Type.STREAM. | ||||
| 			self.server_sockets addLast: sck. | ||||
| 			sck bind: laddr. | ||||
| 		}. | ||||
|  | ||||
		Reference in New Issue
	
	Block a user