diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index b8011951b4..c7084a1a09 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -1825,15 +1825,7 @@ EslSocketConnect (
// Set the next state if connected
//
if ( EFI_NOT_READY != Status ) {
- if ( !EFI_ERROR ( Status )) {
- pSocket->State = SOCKET_STATE_CONNECTED;
-
- //
- // Start the receive operations
- //
- EslSocketRxStart ( pSocket->pPortList );
- }
- else {
+ if ( EFI_ERROR ( Status )) {
pSocket->State = SOCKET_STATE_BOUND;
}
}
@@ -5141,7 +5133,7 @@ EslSocketRxPoll (
- ::EslIp4Receive to restart the receive engine to release flow control.
- ::EslIp4RxComplete to continue the operation of the receive engine if flow control is not being applied.
- - ::EslIp4SocketIsConfigured to start the recevie engine for the new socket.
+ - ::EslIp4SocketIsConfigured to start the receive engine for the new socket.
- ::EslTcp4ListenComplete to start the recevie engine for the new socket.
- ::EslTcp4Receive to restart the receive engine to release flow control.
- ::EslTcp4RxComplete to continue the operation of the receive engine if flow control is not being applied.
diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c
index 4ef46283b4..7ece38d521 100644
--- a/StdLib/EfiSocketLib/Tcp4.c
+++ b/StdLib/EfiSocketLib/Tcp4.c
@@ -232,6 +232,13 @@ EslTcp4ConnectComplete (
pTcp4->ConfigData.AccessPoint.RemoteAddress.Addr[3],
pTcp4->ConfigData.AccessPoint.RemotePort ));
+ //
+ // Start the receive operations
+ //
+ pSocket->bConfigured = TRUE;
+ pSocket->State = SOCKET_STATE_CONNECTED;
+ EslSocketRxStart ( pPort );
+
//
// Remove the rest of the ports
//
@@ -416,7 +423,6 @@ EslTcp4ConnectPoll (
case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT:
diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c
index b2e5538daf..21c4109d6e 100644
--- a/StdLib/EfiSocketLib/Tcp6.c
+++ b/StdLib/EfiSocketLib/Tcp6.c
@@ -238,6 +238,13 @@ EslTcp6ConnectComplete (
pTcp6->ConfigData.AccessPoint.RemoteAddress.Addr[15],
pTcp6->ConfigData.AccessPoint.RemotePort ));
+ //
+ // Start the receive operations
+ //
+ pSocket->bConfigured = TRUE;
+ pSocket->State = SOCKET_STATE_CONNECTED;
+ EslSocketRxStart ( pPort );
+
//
// Remove the rest of the ports
//
@@ -434,7 +441,6 @@ EslTcp6ConnectPoll (
case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT: