Skip to content

Commit

Permalink
Remove SbSocketIsConnected
Browse files Browse the repository at this point in the history
Change-Id: I1891511b69fa0c8a905026d3a46f9bf41ad8ab00
  • Loading branch information
madhurajayaraman committed Sep 26, 2024
1 parent 3f5c2e1 commit b39e0d6
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 81 deletions.
1 change: 0 additions & 1 deletion starboard/android/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ static_library("starboard_platform") {
"//starboard/shared/posix/socket_get_last_error.cc",
"//starboard/shared/posix/socket_get_local_address.cc",
"//starboard/shared/posix/socket_internal.cc",
"//starboard/shared/posix/socket_is_connected.cc",
"//starboard/shared/posix/socket_is_ipv6_supported.cc",
"//starboard/shared/posix/socket_listen.cc",
"//starboard/shared/posix/socket_receive_from.cc",
Expand Down
4 changes: 0 additions & 4 deletions starboard/common/socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ Socket* Socket::Accept() {
return NULL;
}

bool Socket::IsConnected() {
return SbSocketIsConnected(socket_);
}

bool Socket::IsPending() {
return GetLastError() == kSbSocketPending;
}
Expand Down
1 change: 0 additions & 1 deletion starboard/elf_loader/exported_symbols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ ExportedSymbols::ExportedSymbols() {
REGISTER_SYMBOL(SbSocketGetInterfaceAddress);
REGISTER_SYMBOL(SbSocketGetLastError);
REGISTER_SYMBOL(SbSocketGetLocalAddress);
REGISTER_SYMBOL(SbSocketIsConnected);
REGISTER_SYMBOL(SbSocketIsIpv6Supported);
REGISTER_SYMBOL(SbSocketListen);
REGISTER_SYMBOL(SbSocketReceiveFrom);
Expand Down
1 change: 0 additions & 1 deletion starboard/linux/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ static_library("starboard_platform_sources") {
"//starboard/shared/posix/socket_get_last_error.cc",
"//starboard/shared/posix/socket_get_local_address.cc",
"//starboard/shared/posix/socket_internal.cc",
"//starboard/shared/posix/socket_is_connected.cc",
"//starboard/shared/posix/socket_is_ipv6_supported.cc",
"//starboard/shared/posix/socket_listen.cc",
"//starboard/shared/posix/socket_receive_from.cc",
Expand Down
7 changes: 3 additions & 4 deletions starboard/nplb/socket_is_connected_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if SB_API_VERSION < 17

#include <utility>

#include "starboard/common/log.h"
Expand Down Expand Up @@ -41,7 +43,6 @@ TEST_F(SbSocketIsConnectedTest, RainyDayInvalidSocket) {
EXPECT_FALSE(SbSocketIsConnected(kSbSocketInvalid));
}

#if SB_API_VERSION < 17
TEST_P(PairSbSocketIsConnectedTest, SunnyDay) {
ConnectedTrio trio =
CreateAndConnect(GetServerAddressType(), GetClientAddressType(),
Expand All @@ -62,7 +63,6 @@ TEST_P(PairSbSocketIsConnectedTest, SunnyDay) {
EXPECT_TRUE(SbSocketDestroy(trio.client_socket));
EXPECT_TRUE(SbSocketDestroy(trio.listen_socket));
}
#endif // SB_API_VERSION < 17

TEST_P(SbSocketIsConnectedTest, SunnyDayNotConnected) {
SbSocket socket = SbSocketCreate(GetAddressType(), kSbSocketProtocolTcp);
Expand All @@ -71,15 +71,13 @@ TEST_P(SbSocketIsConnectedTest, SunnyDayNotConnected) {
EXPECT_TRUE(SbSocketDestroy(socket));
}

#if SB_API_VERSION < 17
TEST_P(SbSocketIsConnectedTest, SunnyDayListeningNotConnected) {
SbSocket server_socket =
CreateListeningTcpSocket(GetAddressType(), GetPortNumberForTests());
ASSERT_TRUE(SbSocketIsValid(server_socket));
EXPECT_FALSE(SbSocketIsConnected(server_socket));
EXPECT_TRUE(SbSocketDestroy(server_socket));
}
#endif // SB_API_VERSION < 17

INSTANTIATE_TEST_CASE_P(SbSocketAddressTypes,
SbSocketIsConnectedTest,
Expand All @@ -98,3 +96,4 @@ INSTANTIATE_TEST_CASE_P(
} // namespace
} // namespace nplb
} // namespace starboard
#endif // SB_API_VERSION < 17
1 change: 0 additions & 1 deletion starboard/raspi/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ static_library("starboard_platform_sources") {
"//starboard/shared/posix/socket_get_last_error.cc",
"//starboard/shared/posix/socket_get_local_address.cc",
"//starboard/shared/posix/socket_internal.cc",
"//starboard/shared/posix/socket_is_connected.cc",
"//starboard/shared/posix/socket_is_ipv6_supported.cc",
"//starboard/shared/posix/socket_listen.cc",
"//starboard/shared/posix/socket_receive_from.cc",
Expand Down
41 changes: 0 additions & 41 deletions starboard/shared/posix/socket_is_connected.cc

This file was deleted.

19 changes: 0 additions & 19 deletions starboard/shared/stub/socket_is_connected.cc

This file was deleted.

8 changes: 0 additions & 8 deletions starboard/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ SB_EXPORT SbSocketError SbSocketListen(SbSocket socket);
// |socket|: The SbSocket that is accepting a pending connection.
SB_EXPORT SbSocket SbSocketAccept(SbSocket socket);

// DEPRECATED with SB_API_VERSION 16
//
// Indicates whether |socket| is connected to anything. Invalid sockets are not
// connected.
//
// |socket|: The SbSocket to be checked.
SB_EXPORT bool SbSocketIsConnected(SbSocket socket);

// DEPRECATED with SB_API_VERSION 16
//
// Returns the last error set on |socket|. If |socket| is not valid, this
Expand Down
1 change: 0 additions & 1 deletion starboard/stub/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ static_library("stub_sources") {
"//starboard/shared/stub/socket_get_interface_address.cc",
"//starboard/shared/stub/socket_get_last_error.cc",
"//starboard/shared/stub/socket_get_local_address.cc",
"//starboard/shared/stub/socket_is_connected.cc",
"//starboard/shared/stub/socket_is_ipv6_supported.cc",
"//starboard/shared/stub/socket_listen.cc",
"//starboard/shared/stub/socket_receive_from.cc",
Expand Down

0 comments on commit b39e0d6

Please sign in to comment.