whisker.rawsocketclient

whisker/rawsocketclient.py


Copyright © 2011-2020 Rudolf Cardinal (rudolf@pobox.com).

This file is part of the Whisker Python client library.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Framework for Whisker Python clients using raw sockets.

CONSIDER USING THE TWISTED OR QT FRAMEWORKS INSTEAD.

  • Created: 18 Aug 2011.
  • Last update: 10 Feb 2016
class whisker.rawsocketclient.WhiskerRawSocketClient[source]

Basic Whisker class, in which clients do all the work via raw network sockets.

(Not sophisticated. Use whisker.twistedclient.WhiskerTwistedTask instead.)

connect_both_ports(server: str, mainport: Union[str, int]) → bool[source]

Connect the main and immediate ports to the server.

connect_immediate(server: str, portstring: Union[str, int], code: str) → bool[source]

Connect the immediate port to the server.

connect_main(server: str, portstring: Union[str, int]) → bool[source]

Connect the main port to the server.

getlines_immsock() → Generator[[str, None], None][source]

Yield a set of lines from the immediate socket.

getlines_mainsock() → Generator[[str, None], None][source]

Yield a set of lines from the main socket.

log_out() → None[source]

Shut down the connection to Whisker.

send(s: str) → None[source]

Send something to the server on the main socket, with a trailing newline.

send_immediate(s: str) → str[source]

Send a command to the server on the immediate socket, and retrieve its reply.

classmethod set_verbose_logging(verbose: bool) → None[source]

Set the Python log level.