mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
added another ctor to WebSocket
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// WebSocket.h
|
// WebSocket.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.4/Net/include/Poco/Net/WebSocket.h#1 $
|
// $Id: //poco/1.4/Net/include/Poco/Net/WebSocket.h#2 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: WebSocket
|
// Package: WebSocket
|
||||||
@@ -186,15 +186,18 @@ public:
|
|||||||
/// The result of the handshake can be obtained from the response
|
/// The result of the handshake can be obtained from the response
|
||||||
/// object.
|
/// object.
|
||||||
|
|
||||||
|
WebSocket(const Socket& socket);
|
||||||
|
/// Creates a WebSocket from another Socket, which must be a WebSocket,
|
||||||
|
/// otherwise a Poco::InvalidArgumentException will be thrown.
|
||||||
|
|
||||||
virtual ~WebSocket();
|
virtual ~WebSocket();
|
||||||
/// Destroys the StreamSocket.
|
/// Destroys the StreamSocket.
|
||||||
|
|
||||||
WebSocket& operator = (const Socket& socket);
|
WebSocket& operator = (const Socket& socket);
|
||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
///
|
///
|
||||||
/// Releases the socket's SocketImpl and
|
/// The other socket must be a WebSocket, otherwise a Poco::InvalidArgumentException
|
||||||
/// attaches the SocketImpl from the other socket and
|
/// will be thrown.
|
||||||
/// increments the reference count of the SocketImpl.
|
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
/// Sends a Close control frame to the server end of
|
/// Sends a Close control frame to the server end of
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// WebSocket.cpp
|
// WebSocket.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.4/Net/src/WebSocket.cpp#4 $
|
// $Id: //poco/1.4/Net/src/WebSocket.cpp#6 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: WebSocket
|
// Package: WebSocket
|
||||||
@@ -79,6 +79,14 @@ WebSocket::WebSocket(HTTPClientSession& cs, HTTPRequest& request, HTTPResponse&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
WebSocket::WebSocket(const Socket& socket):
|
||||||
|
StreamSocket(socket)
|
||||||
|
{
|
||||||
|
if (!dynamic_cast<WebSocketImpl*>(impl()))
|
||||||
|
throw InvalidArgumentException("Cannot assign incompatible socket");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WebSocket::~WebSocket()
|
WebSocket::~WebSocket()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user