Hello, Alexandru IANCU <[email protected]> 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
