浏览代码

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 年之前
父节点
当前提交
2ce9a705e3
共有 1 个文件被更改,包括 1 次插入0 次删除
  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)
 KResult UDPSocket::protocol_connect(FileDescription&, ShouldBlock)
 {
 {
     m_role = Role::Connected;
     m_role = Role::Connected;
+    set_connected(true);
     return KSuccess;
     return KSuccess;
 }
 }