We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


This interface is notified whenever a server socket accepts a new connection. The transport is in the connected state, and read/write streams can be opened using the normal nsITransport API. The address of the client can be found by calling the nsISocketTransport.GetAddress() method or by inspecting nsISocketTransport.GetHost(), which returns a string representation of the client's IP address, which may be either an IPv4 or an IPv6 address.
Inherits from: nsISupports Last changed in Gecko 1.7

Method overview

void onSocketAccepted(in nsIServerSocket aServ, in nsISocketTransport aTransport);
void onStopListening(in nsIServerSocket aServ, in nsresult aStatus);



This method is called when a client connection is accepted.

void onSocketAccepted(
  in nsIServerSocket aServ,
  in nsISocketTransport aTransport
The server socket.
The connected socket transport.


This method is called when the listening socket stops for some reason. The server socket is effectively dead after this notification.

void onStopListening(
  in nsIServerSocket aServ,
  in nsresult aStatus
The server socket.
The reason why the server socket stopped listening. If the server socket was manually closed, then this value will be NS_BINDING_ABORTED.

See also

Document Tags and Contributors

Contributors to this page: Sheppy, fscholz, Hashem
Last updated by: Sheppy,