File tree Expand file tree Collapse file tree 2 files changed +29
-29
lines changed Expand file tree Collapse file tree 2 files changed +29
-29
lines changed Original file line number Diff line number Diff line change @@ -924,34 +924,5 @@ cdef class CoreProtocol:
924
924
cdef _on_connection_lost(self , exc):
925
925
pass
926
926
927
- # asyncio callbacks:
928
-
929
- def data_received (self , data ):
930
- self .buffer.feed_data(data)
931
- self ._read_server_messages()
932
-
933
- def connection_made (self , transport ):
934
- self .transport = transport
935
-
936
- sock = transport.get_extra_info(' socket' )
937
- if (sock is not None and
938
- (not hasattr (socket, ' AF_UNIX' )
939
- or sock.family != socket.AF_UNIX)):
940
- sock.setsockopt(socket.IPPROTO_TCP,
941
- socket.TCP_NODELAY, 1 )
942
-
943
- try :
944
- self ._connect()
945
- except Exception as ex:
946
- transport.abort()
947
- self .con_status = CONNECTION_BAD
948
- self ._set_state(PROTOCOL_FAILED)
949
- self ._on_error(ex)
950
-
951
- def connection_lost (self , exc ):
952
- self .con_status = CONNECTION_BAD
953
- self ._set_state(PROTOCOL_FAILED)
954
- self ._on_connection_lost(exc)
955
-
956
927
957
928
cdef bytes SYNC_MESSAGE = bytes(WriteBuffer.new_message(b' S' ).end_message())
Original file line number Diff line number Diff line change @@ -883,6 +883,35 @@ cdef class BaseProtocol(CoreProtocol):
883
883
self .closing = True
884
884
self ._handle_waiter_on_connection_lost(exc)
885
885
886
+ # asyncio callbacks:
887
+
888
+ def data_received (self , data ):
889
+ self .buffer.feed_data(data)
890
+ self ._read_server_messages()
891
+
892
+ def connection_made (self , transport ):
893
+ self .transport = transport
894
+
895
+ sock = transport.get_extra_info(' socket' )
896
+ if (sock is not None and
897
+ (not hasattr (socket, ' AF_UNIX' )
898
+ or sock.family != socket.AF_UNIX)):
899
+ sock.setsockopt(socket.IPPROTO_TCP,
900
+ socket.TCP_NODELAY, 1 )
901
+
902
+ try :
903
+ self ._connect()
904
+ except Exception as ex:
905
+ transport.abort()
906
+ self .con_status = CONNECTION_BAD
907
+ self ._set_state(PROTOCOL_FAILED)
908
+ self ._on_error(ex)
909
+
910
+ def connection_lost (self , exc ):
911
+ self .con_status = CONNECTION_BAD
912
+ self ._set_state(PROTOCOL_FAILED)
913
+ self ._on_connection_lost(exc)
914
+
886
915
def pause_writing (self ):
887
916
self .writing_allowed.clear()
888
917
You can’t perform that action at this time.
0 commit comments