OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/tcp_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <netdb.h> | 9 #include <netdb.h> |
10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 688 } |
689 | 689 |
690 if (result != ERR_IO_PENDING) { | 690 if (result != ERR_IO_PENDING) { |
691 write_buf_ = NULL; | 691 write_buf_ = NULL; |
692 write_buf_len_ = 0; | 692 write_buf_len_ = 0; |
693 write_socket_watcher_.StopWatchingFileDescriptor(); | 693 write_socket_watcher_.StopWatchingFileDescriptor(); |
694 DoWriteCallback(result); | 694 DoWriteCallback(result); |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 int TCPClientSocketLibevent::GetPeerAddress(AddressList* address) const { | 698 int TCPClientSocketLibevent::GetPeerAddress(IPEndPoint* address) const { |
699 DCHECK(CalledOnValidThread()); | 699 DCHECK(CalledOnValidThread()); |
700 DCHECK(address); | 700 DCHECK(address); |
701 if (!IsConnected()) | 701 if (!IsConnected()) |
702 return ERR_SOCKET_NOT_CONNECTED; | 702 return ERR_SOCKET_NOT_CONNECTED; |
703 *address = AddressList(addresses_[current_address_index_]); | 703 *address = addresses_[current_address_index_]; |
704 return OK; | 704 return OK; |
705 } | 705 } |
706 | 706 |
707 int TCPClientSocketLibevent::GetLocalAddress(IPEndPoint* address) const { | 707 int TCPClientSocketLibevent::GetLocalAddress(IPEndPoint* address) const { |
708 DCHECK(CalledOnValidThread()); | 708 DCHECK(CalledOnValidThread()); |
709 DCHECK(address); | 709 DCHECK(address); |
710 if (!IsConnected()) | 710 if (!IsConnected()) |
711 return ERR_SOCKET_NOT_CONNECTED; | 711 return ERR_SOCKET_NOT_CONNECTED; |
712 | 712 |
713 SockaddrStorage storage; | 713 SockaddrStorage storage; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 base::TimeDelta TCPClientSocketLibevent::GetConnectTimeMicros() const { | 746 base::TimeDelta TCPClientSocketLibevent::GetConnectTimeMicros() const { |
747 return connect_time_micros_; | 747 return connect_time_micros_; |
748 } | 748 } |
749 | 749 |
750 NextProto TCPClientSocketLibevent::GetNegotiatedProtocol() const { | 750 NextProto TCPClientSocketLibevent::GetNegotiatedProtocol() const { |
751 return kProtoUnknown; | 751 return kProtoUnknown; |
752 } | 752 } |
753 | 753 |
754 } // namespace net | 754 } // namespace net |
OLD | NEW |