summaryrefslogtreecommitdiff
path: root/io/source/connector
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2001-03-15 10:10:54 +0000
committerJörg Budischewski <jbu@openoffice.org>2001-03-15 10:10:54 +0000
commitea72f810c8799e02cc2aba2c39e4f71d4f897bce (patch)
treec0504220263c1d32e94ec65ced3018fdd33f0131 /io/source/connector
parent00c1f1d2ea7535733e29ec609ab3035c27f6c024 (diff)
vos removed in favor of osl inline wrapper
Diffstat (limited to 'io/source/connector')
-rw-r--r--io/source/connector/connector.cxx26
-rw-r--r--io/source/connector/connector.hxx18
-rw-r--r--io/source/connector/ctr_socket.cxx24
-rw-r--r--io/source/connector/makefile.mk5
4 files changed, 25 insertions, 48 deletions
diff --git a/io/source/connector/connector.cxx b/io/source/connector/connector.cxx
index 1614af3dcc92..d11684023932 100644
--- a/io/source/connector/connector.cxx
+++ b/io/source/connector/connector.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: connector.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jl $ $Date: 2001-03-12 15:51:12 $
+ * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,7 +76,6 @@
using namespace ::osl;
using namespace ::rtl;
using namespace ::cppu;
-using namespace ::vos;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;
@@ -214,7 +213,8 @@ namespace stoc_connector
PipeConnection *pConn = new PipeConnection(sName , sConnectionDescription );
- if( pConn->m_pipe.create( sName.pData, ::vos::OPipe::TOption_Open ) )
+ ;
+ if( pConn->m_pipe.create( sName.pData, osl_Pipe_OPEN ) )
{
r = Reference < XConnection > ( (XConnection * ) pConn );
}
@@ -259,23 +259,13 @@ namespace stoc_connector
SocketConnection *pConn = new SocketConnection( sHost ,
nPort ,
sConnectionDescription);
- if( ! pConn->m_socket.bind( pConn->m_addr ) )
- {
- OUString sMessage = OUString::createFromAscii( "Connector : couldn't bind socket (" );
- OUString sError;
- pConn->m_socket.getError( sError );
- sMessage += sError;
- sMessage += OUString::createFromAscii( ")" );
- delete pConn;
- throw ConnectionSetupException( sMessage, Reference < XInterface >() );
- }
- pConn->m_socket.setTcpNoDelay( 1 );
- OInetSocketAddr AddrTarget( sHost.pData, nPort );
+
+ pConn->m_socket.setOption( osl_Socket_OptionTcpNoDelay , sal_True );
+ SocketAddr AddrTarget( sHost.pData, nPort );
if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok)
{
OUString sMessage = OUString::createFromAscii( "Connector : couldn't connect to socket (" );
- OUString sError;
- pConn->m_socket.getError( sError );
+ OUString sError = pConn->m_socket.getErrorAsString();
sMessage += sError;
sMessage += OUString::createFromAscii( ")" );
delete pConn;
diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx
index 9c200a7610dd..59789845fea7 100644
--- a/io/source/connector/connector.hxx
+++ b/io/source/connector/connector.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: connector.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jbu $ $Date: 2000-11-28 08:20:57 $
+ * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,11 +67,11 @@
#include <hash_set>
-#ifndef _VOS_SOCKET_HXX_
-# include <vos/socket.hxx>
+#ifndef _OSL_SOCKET_HXX_
+# include <osl/socket.hxx>
#endif
-#ifndef _VOS_PIPE_HXX_
-# include <vos/pipe.hxx>
+#ifndef _OSL_PIPE_HXX_
+# include <osl/pipe.hxx>
#endif
namespace stoc_connector
@@ -123,7 +123,7 @@ namespace stoc_connector
virtual ::rtl::OUString SAL_CALL getDescription( )
throw(::com::sun::star::uno::RuntimeException);
public:
- ::vos::OStreamPipe m_pipe;
+ ::osl::StreamPipe m_pipe;
oslInterlockedCount m_nStatus;
::rtl::OUString m_sDescription;
};
@@ -161,8 +161,8 @@ namespace stoc_connector
public:
void completeConnectionString();
- ::vos::OConnectorSocket m_socket;
- ::vos::OInetSocketAddr m_addr;
+ ::osl::ConnectorSocket m_socket;
+ ::osl::SocketAddr m_addr;
oslInterlockedCount m_nStatus;
::rtl::OUString m_sDescription;
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index af7ad86b86f9..6d26573f1649 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ctr_socket.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jbu $ $Date: 2000-11-28 08:20:57 $
+ * last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,26 +131,20 @@ namespace stoc_connector {
void SocketConnection::completeConnectionString()
{
- OUString sHost;
sal_Int32 nPort;
nPort = m_socket.getPeerPort();
- m_socket.getPeerHost( sHost );
OUStringBuffer buf( 256 );
buf.appendAscii( ",peerPort=" );
buf.append( (sal_Int32) nPort );
buf.appendAscii( ",peerHost=" );
- buf.append( sHost );
-
-
- nPort = m_socket.getLocalPort();
- m_socket.getLocalHost( sHost );
+ buf.append( m_socket.getPeerHost() );
buf.appendAscii( ",localPort=" );
buf.append( (sal_Int32) nPort );
buf.appendAscii( ",localHost=" );
- buf.append( sHost );
+ buf.append( m_socket.getLocalHost( ) );
m_sDescription += buf.makeStringAndClear();
}
@@ -171,11 +165,8 @@ namespace stoc_connector {
if(i != nBytesToRead)
{
- OUString errMessage;
- m_socket.getError(errMessage);
-
OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::read: error - "));
- message += errMessage;
+ message += m_socket.getErrorAsString();
IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
@@ -212,11 +203,8 @@ namespace stoc_connector {
{
if( m_socket.write( seq.getConstArray() , seq.getLength() ) != seq.getLength() )
{
- OUString errMessage;
- m_socket.getError(errMessage);
-
OUString message(RTL_CONSTASCII_USTRINGPARAM("ctr_socket.cxx:SocketConnection::write: error - "));
- message += errMessage;
+ message += m_socket.getErrorAsString();
IOException ioException(message, Reference<XInterface>(static_cast<XConnection *>(this)));
diff --git a/io/source/connector/makefile.mk b/io/source/connector/makefile.mk
index 19db2ec7ecc6..8b036aa862a5 100644
--- a/io/source/connector/makefile.mk
+++ b/io/source/connector/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.8 $
#
-# last change: $Author: pluby $ $Date: 2001-03-02 07:15:40 $
+# last change: $Author: jbu $ $Date: 2001-03-15 11:09:54 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -91,7 +91,6 @@ SHL1TARGET= $(TARGET)
SHL1STDLIBS= \
$(SALLIB) \
$(CPPULIB) \
- $(VOSLIB) \
$(CPPUHELPERLIB)
SHL1DEPN=