* Added flags field in net_protocol_module_info; there is currently a single

defined flag: NET_PROTOCOL_ATOMIC_MESSAGES.
* socket_send() now honours NET_PROTOCOL_ATOMIC_MESSAGES and returns either
  EMSGSIZE if the data to be send is larger than net_socket::send::buffer_size,
  or divides the data in appropriately sized chunks.
* This fixes sending >=64K over a TCP socket at once (TCP would just have
  returned an error in that case).
* TCP now overrides the default send buffer size (to 32768 for now).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23915 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-02-07 15:09:19 +00:00
parent 032f765603
commit 6f58064f10
8 changed files with 121 additions and 47 deletions
+5 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef NET_PROTOCOL_H
@@ -22,8 +22,12 @@ typedef struct net_protocol {
net_socket *socket;
} net_protocol;
// net_protocol_module_info::flags field
#define NET_PROTOCOL_ATOMIC_MESSAGES 0x01
struct net_protocol_module_info {
module_info info;
uint32 flags;
net_protocol *(*init_protocol)(net_socket *socket);
status_t (*uninit_protocol)(net_protocol *self);