[racket] network server with places?
Thanks! -J
On Mon, Jun 6, 2011 at 9:24 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> I think places should somehow provide better support for this task.
>
> For now, using the FFI you could use scheme_get_port_fd() to extract a
> TCP port's file descriptor as an integer, dup() it, send the dup()ed
> integer to another place, and create new ports using
> scheme_make_fd_input_port() and scheme_make_fd_output_port() on the
> dup()ed file descriptor in the new place, and then close the TCP ports
> in the original place.
>
> At Sun, 5 Jun 2011 21:50:22 -0400, Jon Zeppieri wrote:
>> On Sun, Jun 5, 2011 at 9:39 PM, Robby Findler
>> <robby at eecs.northwestern.edu> wrote:
>> > I don't know about the feasibility of making one of those marshall
>> > across a place channel but in the meantime does it make sense for you
>> > to read the request on the main place, send the data to a separate
>> > place to process and the send the result back? Or is most of the work
>> > in reading and writing the data?
>>
>> Well, that's what I meant by "handling all socket I/O in the 'main'
>> place," and I'm afraid that's exactly what I want to avoid doing.
>>
>> -Jon
>>
>>
>> >
>> > Robby
>> >
>> > On Sunday, June 5, 2011, Jon Zeppieri <zeppieri at gmail.com> wrote:
>> >> Is there a way to write a network server using places, where separate
>> >> client connections would be handled by separate worker places? Since
>> >> neither TCP listeners nor ports can be sent over a place-channel, I
>> >> can't figure out a way of doing this short of handling all socket I/O
>> >> in the "main" place --- the one that manages the listener.
>> >>
>> >> What I'd like is either for the workers to accept their own
>> >> connections (but that would require a shared listener) or to have the
>> >> main place accept connections but hand them off to the workers. I
>> >> don't know if there is any way to accomplish this right now, and if
>> >> there isn't, I don't know what the right approach would be.
>> >>
>> >> -Jon
>> >> _________________________________________________
>> >> For list-related administrative tasks:
>> >> http://lists.racket-lang.org/listinfo/users
>> >>
>> >
>>
>> _________________________________________________
>> For list-related administrative tasks:
>> http://lists.racket-lang.org/listinfo/users
>