diff options
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/dir_access_unix.cpp | 8 | ||||
-rw-r--r-- | drivers/unix/dir_access_unix.h | 2 | ||||
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.h | 2 | ||||
-rw-r--r-- | drivers/unix/stream_peer_tcp_posix.cpp | 20 | ||||
-rw-r--r-- | drivers/unix/stream_peer_tcp_posix.h | 6 |
6 files changed, 20 insertions, 20 deletions
diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index 3bb30700db..a09cf80e6c 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -44,20 +44,20 @@ DirAccess *DirAccessUnix::create_fs() { return memnew( DirAccessUnix ); } -bool DirAccessUnix::list_dir_begin() { +Error DirAccessUnix::list_dir_begin() { list_dir_end(); //close any previous dir opening! -// char real_current_dir_name[2048]; //is this enough?! + //char real_current_dir_name[2048]; //is this enough?! //getcwd(real_current_dir_name,2048); //chdir(curent_path.utf8().get_data()); dir_stream = opendir(current_dir.utf8().get_data()); //chdir(real_current_dir_name); if (!dir_stream) - return true; //error! + return ERR_CANT_OPEN; //error! - return false; + return OK; } bool DirAccessUnix::file_exists(String p_file) { diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index 324d2a379c..f075c48268 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -57,7 +57,7 @@ protected: public: - virtual bool list_dir_begin(); ///< This starts dir listing + virtual Error list_dir_begin(); ///< This starts dir listing virtual String get_next(); virtual bool current_is_dir() const; virtual bool current_is_hidden() const; diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 4d9ef6cdae..6adb3eea70 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -230,7 +230,7 @@ int PacketPeerUDPPosix::_get_socket() { } -void PacketPeerUDPPosix::set_send_address(const IP_Address& p_address,int p_port) { +void PacketPeerUDPPosix::set_dest_address(const IP_Address& p_address,int p_port) { peer_addr=p_address; peer_port=p_port; diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index 89b8886cf5..ead7174a9d 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.h @@ -73,7 +73,7 @@ public: virtual IP_Address get_packet_address() const; virtual int get_packet_port() const; - virtual void set_send_address(const IP_Address& p_address,int p_port); + virtual void set_dest_address(const IP_Address& p_address,int p_port); static void make_default(); diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index f2a1417920..82f3115f4b 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -139,14 +139,14 @@ void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, peer_port = p_port; }; -Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { +Error StreamPeerTCPPosix::connect_to_host(const IP_Address& p_host, uint16_t p_port) { ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == -1) { ERR_PRINT("Socket creation failed!"); - disconnect(); + disconnect_from_host(); //perror("socket"); return FAILED; }; @@ -165,7 +165,7 @@ Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == -1 && errno != EINPROGRESS) { ERR_PRINT("Connection to remote host failed!"); - disconnect(); + disconnect_from_host(); return FAILED; }; @@ -217,7 +217,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, if (errno != EAGAIN) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -243,7 +243,7 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, bool p_block) { - if (!is_connected()) { + if (!is_connected_to_host()) { return FAILED; }; @@ -274,7 +274,7 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b if (errno != EAGAIN) { perror("shit?"); - disconnect(); + disconnect_from_host(); ERR_PRINT("Server disconnected!\n"); return FAILED; }; @@ -308,12 +308,12 @@ Error StreamPeerTCPPosix::read(uint8_t* p_buffer, int p_bytes,int &r_received, b void StreamPeerTCPPosix::set_nodelay(bool p_enabled) { - ERR_FAIL_COND(!is_connected()); + ERR_FAIL_COND(!is_connected_to_host()); int flag=p_enabled?1:0; setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int)); } -bool StreamPeerTCPPosix::is_connected() const { +bool StreamPeerTCPPosix::is_connected_to_host() const { if (status == STATUS_NONE || status == STATUS_ERROR) { @@ -336,7 +336,7 @@ StreamPeerTCP::Status StreamPeerTCPPosix::get_status() const { }; -void StreamPeerTCPPosix::disconnect() { +void StreamPeerTCPPosix::disconnect_from_host() { if (sockfd != -1) close(sockfd); @@ -398,7 +398,7 @@ StreamPeerTCPPosix::StreamPeerTCPPosix() { StreamPeerTCPPosix::~StreamPeerTCPPosix() { - disconnect(); + disconnect_from_host(); }; #endif diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index 1df509cac4..e0091d55b7 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -59,7 +59,7 @@ protected: public: - virtual Error connect(const IP_Address& p_host, uint16_t p_port); + virtual Error connect_to_host(const IP_Address& p_host, uint16_t p_port); virtual Error put_data(const uint8_t* p_data,int p_bytes); virtual Error put_partial_data(const uint8_t* p_data,int p_bytes, int &r_sent); @@ -74,9 +74,9 @@ public: virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; - virtual bool is_connected() const; + virtual bool is_connected_to_host() const; virtual Status get_status() const; - virtual void disconnect(); + virtual void disconnect_from_host(); virtual void set_nodelay(bool p_enabled); |