bug-myserver
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-myserver] Re: [Fwd: Re: something to play with]


From: Giuseppe Scrivano
Subject: [bug-myserver] Re: [Fwd: Re: something to play with]
Date: Sat, 25 Apr 2009 15:58:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hello,

Alexandru IANCU <address@hidden> writes:

>> Which advantages will we have to move it away from there?
>
> When I proposed to move it from there I was thinking at 2 issues:
> 1. notifications - I'm not sure how to handle them: centralized per
> socket or per stream ID. If we'll handle notifications per stream ID
> there is no need to move recv call from ClientsThread.

Notifications should be for stream ID, only in this way we can schedule
the same SCTP socket on different threads.


> 2. incomplete messages
> I may receive incomplete messages. How to tell if on the next read I'll
> have a message for this stream ID or for another that needs to be
> handled by another ClientsThread.

A thread should read only on its stream without care what other streams
contain.  Beside the SCTP socket class we can have another that works on
a single stream and can be used as a TCP socket, operations like
socket.recv (streamId, data), socket.send (streamId, data) are
automatically wrapped to stream.recv (data), stream.send (data).  In
this way HTTP and FTP can work with small changes, except where a file
descriptor is needed (sendfile) and when another connection/stream is
needed (FTP file transfer).

Regards,
Giuseppe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]