28880. socket transport now provides access to the underlying ip address
git-svn-id: svn://10.0.0.236/trunk@67924 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
607c6f8f66
commit
c2cdc700b2
@ -25,37 +25,43 @@
|
|||||||
[scriptable, uuid(785CA0F0-C39E-11d3-9ED6-0010A4053FD0)]
|
[scriptable, uuid(785CA0F0-C39E-11d3-9ED6-0010A4053FD0)]
|
||||||
interface nsISocketTransport : nsISupports
|
interface nsISocketTransport : nsISupports
|
||||||
{
|
{
|
||||||
attribute boolean reuseConnection;
|
attribute boolean reuseConnection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* socket read/write timeout in seconds; 0 = no timeout
|
||||||
|
*/
|
||||||
|
attribute unsigned long socketTimeout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* socket connect timeout in seconds; 0 = no timeout
|
||||||
|
*/
|
||||||
|
attribute unsigned long socketConnectTimeout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is used to tell the channel to stop reading data after a certain point;
|
||||||
|
* needed by HTTP/1.1
|
||||||
|
*/
|
||||||
|
attribute long bytesExpected;
|
||||||
|
attribute unsigned long reuseCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the socket is still alive
|
||||||
|
*
|
||||||
|
* @param seconds amount of time after which the socket is always deemed to be
|
||||||
|
* dead (no further checking is done in this case); seconds = 0
|
||||||
|
* will cause it not to do the timeout checking at all
|
||||||
|
*/
|
||||||
|
boolean isAlive (in unsigned long seconds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* maximum amount of time in seconds the transport is allowed to stay alive
|
||||||
|
* while connected (0 - default; no maximum idle timeout)
|
||||||
|
*/
|
||||||
|
attribute unsigned long idleTimeout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* socket read/write timeout in seconds; 0 = no timeout
|
* the string representation of the underlying ip address. Caller
|
||||||
|
* is responsible for de-allocating the returned string.
|
||||||
*/
|
*/
|
||||||
attribute unsigned long socketTimeout;
|
[noscript] string GetIPStr(in unsigned long aStrLen);
|
||||||
|
|
||||||
/**
|
|
||||||
* socket connect timeout in seconds; 0 = no timeout
|
|
||||||
*/
|
|
||||||
attribute unsigned long socketConnectTimeout;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is used to tell the channel to stop reading data after a certain point;
|
|
||||||
* needed by HTTP/1.1
|
|
||||||
*/
|
|
||||||
attribute long bytesExpected;
|
|
||||||
attribute unsigned long reuseCount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the socket is still alive
|
|
||||||
*
|
|
||||||
* @param seconds amount of time after which the socket is always deemed to be
|
|
||||||
* dead (no further checking is done in this case); seconds = 0
|
|
||||||
* will cause it not to do the timeout checking at all
|
|
||||||
*/
|
|
||||||
boolean isAlive (in unsigned long seconds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* maximum amount of time in seconds the transport is allowed to stay alive
|
|
||||||
* while connected (0 - default; no maximum idle timeout)
|
|
||||||
*/
|
|
||||||
attribute unsigned long idleTimeout;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2269,6 +2269,21 @@ nsSocketTransport::SetIdleTimeout (PRUint32 seconds)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsSocketTransport::GetIPStr(PRUint32 aLen, char **_retval) {
|
||||||
|
NS_ASSERTION(aLen > 0, "caller must pass in str len");
|
||||||
|
*_retval = (char*)nsAllocator::Alloc(aLen);
|
||||||
|
if (!*_retval) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
PRStatus status = PR_NetAddrToString(&mNetAddress, *_retval, aLen);
|
||||||
|
|
||||||
|
if (PR_FAILURE == status) {
|
||||||
|
nsAllocator::Free(*_retval);
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsSocketTransport::GetSocketTimeout (PRUint32 * o_Seconds)
|
nsSocketTransport::GetSocketTimeout (PRUint32 * o_Seconds)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user