<s> from sockets . stream_socket import StreamSocket <EOL> from transfer . request import Request <EOL> from transfer . notification import Notification <EOL> import settings <EOL> from groundstation . utils import path2id <EOL> import groundstation . logger <EOL> log = groundstation . logger . getLogger ( __name__ ) <EOL> class StreamClient ( StreamSocket ) : <EOL> def __init__ ( self , addr ) : <EOL> super ( StreamClient , self ) . __init__ ( ) <EOL> self . peer = addr <EOL> self . socket . connect ( ( addr , settings . PORT ) ) <EOL> self . socket . setblocking ( False ) <EOL> def begin_handshake ( self , station ) : <EOL> request = Request ( "<STR_LIT>" , station = station , stream = self ) <EOL> station . register_request ( request ) <EOL> self . enqueue ( request ) <EOL> def notify_new_object ( self , station , path ) : <EOL> obj = path2id ( path ) <EOL> notification = Notification ( "<STR_LIT>" , station = station , stream = self , payload = obj ) <EOL> self . enqueue ( notification ) </s>
