mnSetBufferSizes

This is used to set receive buffer sizes. Packets larger than the specified size cannot be received.

Default buffer sizes are 1024.

This command must be used when the instance is uninitialized.

If buffer sizes are too small for DarkNet to operate (see minimum values below) then mnSetBufferSizes will display an error message. If buffer sizes are smaller than that of an incoming packet then the packet will not be received properly and the client will be disconnected.

This command must be used when the instance is uninitialized.

In client state (mnConnect) the minimum values are:

- UDP_receive_buffer_size = 0

- TCP_receive_buffer_size = 33

In server state (mnStartServer) the minimum values are:

- UDP_receive_buffer_size = 20

- TCP_receive_buffer_size = 0

In broadcast state (mnStartBroadcast) the minimum values are:

- UDP_receive_buffer_size = 0

- TCP_receive_buffer_size = 0

Parameters

int Instance: This is the instance that the command should use.

unsigned int UDP_receive_buffer_size: The maximum size of the receiving UDP buffer.

unsigned int TCP_receive_buffer_size: The maximum size of the receiving TCP buffer.

char State: This is the state that your application will be in:

- 1 = Server state (mnStartServer)

- 2 = Client state (mnConnect)

- 3 = Broadcast state (mnStartBroadcast).

This is used when deciding what the minimum values should be.

Returns (Integer)

0 if no error occurred

-1 if an error occurred.

Present in

DBP

C++

.Net




This page is in the following sections:
(2) Networking Commands
(1) Networking
(0) DarkNet Help