* Added wxsocket lib and sample (I hope I don't forget some file)
* Updated some wx data and makefiles * Updates on wxStream (reorganization) makefile for Windows will nearly follow wxSocket should work on wxGTK (I've tested it) * IPC over Network is included git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
68
src/common/sckstrm.cpp
Normal file
68
src/common/sckstrm.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: sckstrm.h
|
||||
// Purpose: wxSocket*Stream
|
||||
// Author: Guilhem Lavaux
|
||||
// Modified by:
|
||||
// Created: 17/07/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "sckstrm.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stream.h"
|
||||
#include "wx/socket.h"
|
||||
#include "wx/sckstrm.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxSocketOutputStream
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxSocketOutputStream::wxSocketOutputStream(wxSocketBase& s)
|
||||
: m_o_socket(&s)
|
||||
{
|
||||
}
|
||||
|
||||
wxSocketOutputStream::~wxSocketOutputStream()
|
||||
{
|
||||
}
|
||||
|
||||
wxOutputStream& wxSocketOutputStream::Write(const void *buffer, size_t size)
|
||||
{
|
||||
m_o_socket->Write((const char *)buffer, size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxSocketInputStream
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxSocketInputStream::wxSocketInputStream(wxSocketBase& s)
|
||||
: m_i_socket(&s)
|
||||
{
|
||||
}
|
||||
|
||||
wxSocketInputStream::~wxSocketInputStream()
|
||||
{
|
||||
}
|
||||
|
||||
wxInputStream& wxSocketInputStream::Read(void *buffer, size_t size)
|
||||
{
|
||||
m_i_socket->Read((char *)buffer, size);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxSocketStream (IO)
|
||||
// ---------------------------------------------------------------------------
|
||||
wxSocketStream::wxSocketStream(wxSocketBase& i_s, wxSocketBase& o_s)
|
||||
: wxSocketInputStream(i_s), wxSocketOutputStream(o_s)
|
||||
{
|
||||
}
|
||||
|
||||
wxSocketStream::wxSocketStream(wxSocketBase& s)
|
||||
: wxSocketInputStream(s), wxSocketOutputStream(s)
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user