version 1.81.8.4, 2006/06/10 21:54:05
|
version 1.81.8.5, 2006/06/12 18:26:50
|
|
|
{ | { |
NamedPipeMessage* namedPipeMessage = (NamedPipeMessage*)message; | NamedPipeMessage* namedPipeMessage = (NamedPipeMessage*)message; |
| |
// If this is a connection request: |
|
|
|
if (((namedPipeMessage->namedPipe.getPipe()) == ( _rep->namedPipeServer->getPipe())) && | if (((namedPipeMessage->namedPipe.getPipe()) == ( _rep->namedPipeServer->getPipe())) && |
(namedPipeMessage->events & NamedPipeMessage::READ)) | (namedPipeMessage->events & NamedPipeMessage::READ)) |
{ | { |
|
|
| |
if (_localConnection) | if (_localConnection) |
{ | { |
|
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
| |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
PEGASUS_STD(cout) << "in HTTPAcceptor::_bind before calling _createNamedPipe() " << PEGASUS_STD(endl); |
PEGASUS_STD(cout) |
|
<< "in HTTPAcceptor::_bind before calling _createNamedPipe() " |
|
<< PEGASUS_STD(endl); |
// _rep->createNamedPipe(); | // _rep->createNamedPipe(); |
_createNamedPipe(); | _createNamedPipe(); |
PEGASUS_STD(cout) << "in HTTPAcceptor::_bind after calling _createNamedPipe() " << PEGASUS_STD(endl); | PEGASUS_STD(cout) << "in HTTPAcceptor::_bind after calling _createNamedPipe() " << PEGASUS_STD(endl); |
// Not sure if we need to continue to bind non local domain sockets in windows..... |
|
return; | return; |
// #else |
#else |
#endif |
|
|
|
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
|
|
|
reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_family = | reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_family = |
AF_UNIX; | AF_UNIX; |
strcpy(reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path, |
strcpy( |
|
reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path, |
PEGASUS_LOCAL_DOMAIN_SOCKET_PATH); | PEGASUS_LOCAL_DOMAIN_SOCKET_PATH); |
|
|
#ifdef PEGASUS_PLATFORM_OS400_ISERIES_IBM | #ifdef PEGASUS_PLATFORM_OS400_ISERIES_IBM |
AtoE(reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); | AtoE(reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); |
#endif | #endif |
::unlink(reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); | ::unlink(reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); |
|
#endif |
|
|
#else | #else |
PEGASUS_ASSERT(false); | PEGASUS_ASSERT(false); |
#endif | #endif |
|
|
} | } |
| |
// Create socket: | // Create socket: |
|
|
if (_localConnection) | if (_localConnection) |
{ | { |
_rep->socket = socket(AF_UNIX, SOCK_STREAM, 0); | _rep->socket = socket(AF_UNIX, SOCK_STREAM, 0); |
|
|
// Unlink Local Domain Socket Bug# 3312 | // Unlink Local Domain Socket Bug# 3312 |
if (_localConnection) | if (_localConnection) |
{ | { |
|
#ifndef PEGASUS_OS_TYPE_WINDOWS |
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET | #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2, | PEG_TRACE_STRING(TRC_HTTP, Tracer::LEVEL2, |
"HTTPAcceptor::closeConnectionSocket Unlinking local connection." ); | "HTTPAcceptor::closeConnectionSocket Unlinking local connection." ); |
|
|
#else | #else |
PEGASUS_ASSERT(false); | PEGASUS_ASSERT(false); |
#endif | #endif |
|
#endif |
} | } |
| |
} | } |
|
|
if (_localConnection) | if (_localConnection) |
{ | { |
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET | #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
|
#ifndef PEGASUS_OS_TYPE_WINDOWS |
|
|
::unlink( | ::unlink( |
reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); | reinterpret_cast<struct sockaddr_un*>(_rep->address)->sun_path); |
|
#endif |
#else | #else |
PEGASUS_ASSERT(false); | PEGASUS_ASSERT(false); |
#endif | #endif |
|
|
| |
if (_localConnection) | if (_localConnection) |
{ | { |
|
#ifndef PEGASUS_OS_TYPE_WINDOWS |
#ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET | #ifndef PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET |
accept_address = reinterpret_cast<struct sockaddr*>(new struct sockaddr_un); | accept_address = reinterpret_cast<struct sockaddr*>(new struct sockaddr_un); |
address_size = sizeof(struct sockaddr_un); | address_size = sizeof(struct sockaddr_un); |
#else | #else |
PEGASUS_ASSERT(false); | PEGASUS_ASSERT(false); |
#endif | #endif |
|
#endif |
} | } |
else | else |
{ | { |
|
|
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
void HTTPAcceptor::_createNamedPipe() | void HTTPAcceptor::_createNamedPipe() |
{ | { |
PEGASUS_STD(cout) << "in HTTPAcceptor::_createNamedPipe() at the begining" << PEGASUS_STD(endl); |
PEGASUS_STD(cout) << "Entering HTTPAcceptor::_createNamedPipe()." << PEGASUS_STD(endl); |
| |
_rep->namedPipeServer = new NamedPipeServer("\\\\.\\pipe\\MyNamedPipe"); | _rep->namedPipeServer = new NamedPipeServer("\\\\.\\pipe\\MyNamedPipe"); |
PEGASUS_STD(cout) << "in HTTPAcceptor::_createNamedPipe() after calling the pipe server constructor" << PEGASUS_STD(endl); | PEGASUS_STD(cout) << "in HTTPAcceptor::_createNamedPipe() after calling the pipe server constructor" << PEGASUS_STD(endl); |
| |
| |
|
cout << "Named pipe...in _createNamedPipe..." << _rep->namedPipeServer->getPipe() << endl; |
| |
// Register to receive Messages on Connection pipe: | // Register to receive Messages on Connection pipe: |
| |
|
|
| |
} | } |
| |
PEGASUS_STD(cout) << "in HTTPAcceptor::_createNamedPipe() at the end" << PEGASUS_STD(endl); |
PEGASUS_STD(cout) << "Leaving HTTPAcceptor::_createNamedPipe()." << PEGASUS_STD(endl); |
return; | return; |
| |
} | } |