Hi,

I am not sure how actual network read/write, like recv()/send() is
happening in Necko.

I see that, usually, socket traffic is managed by  nsISocketTransport,
but http/src/README says connection will call transport's AsyncWrite
and AsyncRead, I don't understand what are these two methods implying.
Because non of them are defined actually in the code, perhaps the
README is too old.

What I figure out, the outgoing traffic could be done directly
synchronously with
outStream->Write, or asynchronously, with outStream->AsyncWait, then
caller's OnSocketWritable() will be called to write the data to
network. Am I right?

The incoming traffic, usually is done by asynchronously, with a pump,
first construct a pump through NS_NewInputStreamPump, then the
listeners will be notified with input stream has some data.

Seems there are several layers here, seems the reading is a big
problem to me, I can not know how asynchronous reading is happening? I
know nsISocketTransportService is doing a poll, on its owned sockets,
seems after that, nsISocketTransport is going to be notified by its
OnSocketReady(), but who is putting data into the input socket?   The
socket provider?   At least, there should be someone, do a recv()  for
that input socket, and change some state in NSPR, to make that socket
noticeable as readable for the Poll() in transport service?

I wish someone can show me a good graph of the network asynchronous
reading path, thanks a lot!
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to