Browse Source

IPv4: Mark UDP sockets as connected immediately upon connect()

This makes it possible to write() to a blocking UDPSocket. Previously
this was not possible since can_write() depends on is_connected().
Andreas Kling 5 years ago
parent
commit
2ce9a705e3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Kernel/Net/UDPSocket.cpp

+ 1 - 0
Kernel/Net/UDPSocket.cpp

@@ -111,6 +111,7 @@ int UDPSocket::protocol_send(const void* data, int data_length)
 KResult UDPSocket::protocol_connect(FileDescription&, ShouldBlock)
 {
     m_role = Role::Connected;
+    set_connected(true);
     return KSuccess;
 }