51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
*
* @param socket The socket that received a packet
* @param buffer The buffer the packet was stored in
* @param length The length of the packet
* @param sender The address of the sender of the packet
* @param exception An exception which occurred while receiving or `nil` on
* success
* @return A bool whether the same block should be used for the next receive
*/
typedef bool (^OFDatagramSocketPacketReceivedHandler)(OFDatagramSocket *socket,
void *buffer, size_t length, const OFSocketAddress *_Nonnull sender,
id _Nullable exception);
/**
* @brief A block which is called when a packet has been sent.
|
|
|
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
*
* @param socket The socket that received a packet
* @param buffer The buffer the packet was stored in
* @param length The length of the packet
* @param sender The address of the sender of the packet
* @param exception An exception which occurred while receiving or `nil` on
* success
* @return A bool whether the same handler should be used for the next receive
*/
typedef bool (^OFDatagramSocketPacketReceivedHandler)(OFDatagramSocket *socket,
void *buffer, size_t length, const OFSocketAddress *_Nonnull sender,
id _Nullable exception);
/**
* @brief A block which is called when a packet has been sent.
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
*
* @param socket The datagram socket which received a packet
* @param buffer The buffer the packet has been written to
* @param length The length of the packet
* @param sender The address of the sender of the packet
* @param exception An exception that occurred while receiving, or nil on
* success
* @return A bool whether the same block should be used for the next receive
*/
- (bool)socket: (OFDatagramSocket *)socket
didReceiveIntoBuffer: (void *)buffer
length: (size_t)length
sender: (const OFSocketAddress *_Nonnull)sender
exception: (nullable id)exception;
|
|
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
*
* @param socket The datagram socket which received a packet
* @param buffer The buffer the packet has been written to
* @param length The length of the packet
* @param sender The address of the sender of the packet
* @param exception An exception that occurred while receiving, or nil on
* success
* @return A bool whether the same handler should be used for the next receive
*/
- (bool)socket: (OFDatagramSocket *)socket
didReceiveIntoBuffer: (void *)buffer
length: (size_t)length
sender: (const OFSocketAddress *_Nonnull)sender
exception: (nullable id)exception;
|