Qore Programming Language Reference Manual  1.12.2
Qore::SocketPollOperation Class Reference

Socket poll operation object returned by Socket polling methods. More...

Inheritance diagram for Qore::SocketPollOperation:

Public Member Methods

 constructor (Socket socket, string goal, *hash< auto > opts)
 Creates the object with the given goal. More...
 
*hash< SocketPollInfocontinuePoll ()
 Returns a socket poll hash if polling should continue or NOTHING if complete. More...
 
 copy ()
 Throws an exception; objects of this class cannot be copied. More...
 
 destructor ()
 Destroys the object. More...
 
- Public Member Methods inherited from Qore::SocketPollOperationBase
 constructor ()
 Throws an exception; this class is not usable by Qore classes. More...
 
 destructor ()
 Destroys the object.
 
string getGoal ()
 Returns the goal. More...
 
auto getOutput ()
 Returns any output generated by any completed poll action. More...
 
string getState ()
 Returns the current state. More...
 
bool goalReached ()
 Returns True when the goal as been reached. More...
 
- Public Member Methods inherited from Qore::AbstractPollOperation
auto getOutput ()
 Returns any output generated by any completed poll action. More...
 

Detailed Description

Socket poll operation object returned by Socket polling methods.

This class implements the polling logic for Sockets and the state machine behind it

private members:

Since
Qore 1.12

Member Function Documentation

◆ constructor()

Qore::SocketPollOperation::constructor ( Socket  socket,
string  goal,
*hash< auto >  opts 
)

Creates the object with the given goal.

Parameters
socketthe Socket object to poll
goalthe type of goal; currently one of:
  • connect
  • connect-ssl
optsrequired keys depend on goal
  • for goal_type connect and connect-ssl:
    • url (string): the URL to connect to
Exceptions
INVALID-GOALthrown if the goal is invalid

◆ continuePoll()

*hash<SocketPollInfo> Qore::SocketPollOperation::continuePoll ( )
virtual

Returns a socket poll hash if polling should continue or NOTHING if complete.

Returns
NOTHING if there is no more to poll and the poll operation was successful (i.e. the goal was reached), otherwise this method must return a new socket poll hash to continue the polling operation with another operation, after which this method will be called again if a matching event is received for the socket. If a socket poll hash is returned, then the internal state is also updated.

Implements Qore::AbstractPollOperation.

◆ copy()

Qore::SocketPollOperation::copy ( )

Throws an exception; objects of this class cannot be copied.

Exceptions
SOCKETPOLLOPERATION-COPY-ERRORobjects of this class cannot be copied

◆ destructor()

Qore::SocketPollOperation::destructor ( )

Destroys the object.

Destroys the object