version 1.29, 2003/06/14 19:25:38
|
version 1.30, 2003/07/31 14:28:28
|
|
|
#include "HTTPAcceptor.h" | #include "HTTPAcceptor.h" |
#include "HTTPConnection.h" | #include "HTTPConnection.h" |
#include "Tracer.h" | #include "Tracer.h" |
|
#include <Pegasus/Common/MessageLoader.h> //l10n |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
|
|
| |
void HTTPAcceptor::bind() | void HTTPAcceptor::bind() |
{ | { |
if (_rep) |
if (_rep){ |
throw BindFailedException("HTTPAcceptor already bound"); |
//l10n |
|
//throw BindFailedException("HTTPAcceptor already bound"); |
|
String s0 = "HTTPAcceptor"; |
|
MessageLoaderParms parms("Common.HTTPAcceptor.ALREADY_BOUND", |
|
"$0 already bound", |
|
s0); |
|
throw BindFailedException(parms); |
|
} |
| |
_rep = new HTTPAcceptorRep(_localConnection); | _rep = new HTTPAcceptorRep(_localConnection); |
| |
|
|
{ | { |
delete _rep; | delete _rep; |
_rep = 0; | _rep = 0; |
throw BindFailedException("Failed to create socket"); |
//l10n |
|
//throw BindFailedException("Failed to create socket"); |
|
MessageLoaderParms parms("Common.HTTPAcceptor.FAILED_CREATE_SOCKET", |
|
"Failed to create socket"); |
|
throw BindFailedException(parms); |
} | } |
| |
| |
|
|
Socket::close(_rep->socket); | Socket::close(_rep->socket); |
delete _rep; | delete _rep; |
_rep = 0; | _rep = 0; |
throw BindFailedException("Failed to set socket option"); |
//l10n |
|
//throw BindFailedException("Failed to set socket option"); |
|
MessageLoaderParms parms("Common.HTTPAcceptor.FAILED_SET_SOCKET_OPTION", |
|
"Failed to set socket option"); |
|
throw BindFailedException(parms); |
} | } |
| |
// Bind socket to port: | // Bind socket to port: |
|
|
Socket::close(_rep->socket); | Socket::close(_rep->socket); |
delete _rep; | delete _rep; |
_rep = 0; | _rep = 0; |
throw BindFailedException("Failed to bind socket"); |
//l10n |
|
//throw BindFailedException("Failed to bind socket"); |
|
MessageLoaderParms parms("Common.HTTPAcceptor.FAILED_BIND_SOCKET", |
|
"Failed to bind socket"); |
|
throw BindFailedException(parms); |
} | } |
| |
// Set up listening on the given socket: | // Set up listening on the given socket: |
|
|
Socket::close(_rep->socket); | Socket::close(_rep->socket); |
delete _rep; | delete _rep; |
_rep = 0; | _rep = 0; |
throw BindFailedException("Failed to bind socket"); |
//l10n |
|
//throw BindFailedException("Failed to bind socket"); |
|
MessageLoaderParms parms("Common.HTTPAcceptor.FAILED_BIND_SOCKET", |
|
"Failed to bind socket"); |
|
throw BindFailedException(parms); |
} | } |
| |
// Register to receive SocketMessages on this socket: | // Register to receive SocketMessages on this socket: |
|
|
Socket::close(_rep->socket); | Socket::close(_rep->socket); |
delete _rep; | delete _rep; |
_rep = 0; | _rep = 0; |
throw BindFailedException("Failed to solicit socket messaeges"); |
//l10n |
|
//throw BindFailedException("Failed to solicit socket messaeges"); |
|
MessageLoaderParms parms("Common.HTTPAcceptor.FAILED_SOLICIT_SOCKET_MESSAGES", |
|
"Failed to solicit socket messaeges"); |
|
throw BindFailedException(parms); |
} | } |
} | } |
| |