Skip to content

Commit 7de8a14

Browse files
committed
Sync SDL3_net wiki -> header
[ci skip]
1 parent 46d1b5b commit 7de8a14

File tree

1 file changed

+40
-42
lines changed

1 file changed

+40
-42
lines changed

include/SDL3_net/SDL_net.h

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ extern SDL_DECLSPEC bool SDLCALL NET_Init(void);
101101
* program.
102102
*
103103
* It is safe to call this multiple times; the library will only deinitialize
104-
* once, when this function is called the same number of times as NET_Init
105-
* was successfully called.
104+
* once, when this function is called the same number of times as NET_Init was
105+
* successfully called.
106106
*
107107
* Once you have successfully deinitialized the library, it is safe to call
108108
* NET_Init to reinitialize it for further use.
@@ -140,13 +140,13 @@ typedef struct NET_Address NET_Address; /**< Opaque struct that deals with comp
140140
* NET_WaitUntilResolved(). Otherwise, you can do a non-blocking check with
141141
* NET_GetAddressStatus().
142142
*
143-
* When you are done with the returned NET_Address, call
144-
* NET_UnrefAddress() to dispose of it. You need to do this even if
145-
* resolution later fails asynchronously.
143+
* When you are done with the returned NET_Address, call NET_UnrefAddress() to
144+
* dispose of it. You need to do this even if resolution later fails
145+
* asynchronously.
146146
*
147147
* \param host The hostname to resolve.
148-
* \returns A new NET_Address on success, NULL on error; call
149-
* SDL_GetError() for details.
148+
* \returns A new NET_Address on success, NULL on error; call SDL_GetError()
149+
* for details.
150150
*
151151
* \threadsafety It is safe to call this function from any thread.
152152
*
@@ -162,8 +162,8 @@ extern SDL_DECLSPEC NET_Address * SDLCALL NET_ResolveHostname(const char *host);
162162
/**
163163
* Block until an address is resolved.
164164
*
165-
* The NET_Address objects returned by NET_ResolveHostname take time to
166-
* do their work, so it is does so _asynchronously_ instead of making your
165+
* The NET_Address objects returned by NET_ResolveHostname take time to do
166+
* their work, so it is does so _asynchronously_ instead of making your
167167
* program wait an indefinite amount of time.
168168
*
169169
* However, if you want your program to sleep until the address resolution is
@@ -182,8 +182,8 @@ extern SDL_DECLSPEC NET_Address * SDLCALL NET_ResolveHostname(const char *host);
182182
* Once an address is successfully resolved, it can be used to connect to the
183183
* host represented by the address.
184184
*
185-
* If you don't want your program to block, you can call
186-
* NET_GetAddressStatus from time to time until you get a non-zero result.
185+
* If you don't want your program to block, you can call NET_GetAddressStatus
186+
* from time to time until you get a non-zero result.
187187
*
188188
* \param address The NET_Address object to wait on.
189189
* \param timeout Number of milliseconds to wait for resolution to complete.
@@ -204,8 +204,8 @@ extern SDL_DECLSPEC int SDLCALL NET_WaitUntilResolved(NET_Address *address, Sint
204204
/**
205205
* Check if an address is resolved, without blocking.
206206
*
207-
* The NET_Address objects returned by NET_ResolveHostname take time to
208-
* do their work, so it is does so _asynchronously_ instead of making your
207+
* The NET_Address objects returned by NET_ResolveHostname take time to do
208+
* their work, so it is does so _asynchronously_ instead of making your
209209
* program wait an indefinite amount of time.
210210
*
211211
* This function allows you to check the progress of that work without
@@ -244,8 +244,8 @@ extern SDL_DECLSPEC int SDLCALL NET_GetAddressStatus(NET_Address *address);
244244
* the string.
245245
*
246246
* This will return NULL if resolution is still in progress, or if resolution
247-
* failed. You can use NET_GetAddressStatus() or NET_WaitUntilResolved()
248-
* to make sure resolution has successfully completed before calling this.
247+
* failed. You can use NET_GetAddressStatus() or NET_WaitUntilResolved() to
248+
* make sure resolution has successfully completed before calling this.
249249
*
250250
* \param address The NET_Address to query.
251251
* \returns a string, or NULL on error; call SDL_GetError() for details.
@@ -269,8 +269,8 @@ extern SDL_DECLSPEC const char * SDLCALL NET_GetAddressString(NET_Address *addre
269269
* done with it. The object's resources are freed when the last reference is
270270
* dropped.
271271
*
272-
* This function adds a reference to an NET_Address, increasing its
273-
* reference count by one.
272+
* This function adds a reference to an NET_Address, increasing its reference
273+
* count by one.
274274
*
275275
* The documentation will tell you when the app has to explicitly unref an
276276
* address. For example, NET_ResolveHostname() creates addresses that are
@@ -307,8 +307,8 @@ extern SDL_DECLSPEC NET_Address *SDLCALL NET_RefAddress(NET_Address *address);
307307
* done with it. The object's resources are freed when the last reference is
308308
* dropped.
309309
*
310-
* This function drops a reference to an NET_Address, decreasing its
311-
* reference count by one.
310+
* This function drops a reference to an NET_Address, decreasing its reference
311+
* count by one.
312312
*
313313
* The documentation will tell you when the app has to explicitly unref an
314314
* address. For example, NET_ResolveHostname() creates addresses that are
@@ -381,9 +381,8 @@ extern SDL_DECLSPEC int SDLCALL NET_CompareAddresses(const NET_Address *a, const
381381
* addresses that are accessible on the same LAN, but not public ones that are
382382
* accessible from the outside Internet.
383383
*
384-
* Usually it's better to use NET_CreateServer() or
385-
* NET_CreateDatagramSocket() with a NULL address, to say "bind to all
386-
* interfaces."
384+
* Usually it's better to use NET_CreateServer() or NET_CreateDatagramSocket()
385+
* with a NULL address, to say "bind to all interfaces."
387386
*
388387
* The array of addresses returned from this is guaranteed to be
389388
* NULL-terminated. You can also pass a pointer to an int, which will return
@@ -469,8 +468,8 @@ typedef struct NET_StreamSocket NET_StreamSocket; /**< a TCP socket. Reliable t
469468
*
470469
* \param address the address of the remote server to connect to.
471470
* \param port the port on the remote server to connect to.
472-
* \returns a new NET_StreamSocket, pending connection, or NULL on error;
473-
* call SDL_GetError() for details.
471+
* \returns a new NET_StreamSocket, pending connection, or NULL on error; call
472+
* SDL_GetError() for details.
474473
*
475474
* \threadsafety It is safe to call this function from any thread.
476475
*
@@ -485,8 +484,8 @@ extern SDL_DECLSPEC NET_StreamSocket * SDLCALL NET_CreateClient(NET_Address *add
485484
/**
486485
* Block until a stream socket has connected to a server.
487486
*
488-
* The NET_StreamSocket objects returned by NET_CreateClient take time
489-
* to do their work, so it is does so _asynchronously_ instead of making your
487+
* The NET_StreamSocket objects returned by NET_CreateClient take time to do
488+
* their work, so it is does so _asynchronously_ instead of making your
490489
* program wait an indefinite amount of time.
491490
*
492491
* However, if you want your program to sleep until the connection is
@@ -663,8 +662,8 @@ extern SDL_DECLSPEC NET_Address * SDLCALL NET_GetStreamSocketAddress(NET_StreamS
663662
/**
664663
* Check if a stream socket is connected, without blocking.
665664
*
666-
* The NET_StreamSocket objects returned by NET_CreateClient take time
667-
* to do negotiate a connection to a server, so it is does so _asynchronously_
665+
* The NET_StreamSocket objects returned by NET_CreateClient take time to do
666+
* negotiate a connection to a server, so it is does so _asynchronously_
668667
* instead of making your program wait an indefinite amount of time.
669668
*
670669
* This function allows you to check the progress of that work without
@@ -790,8 +789,8 @@ extern SDL_DECLSPEC int SDLCALL NET_GetStreamSocketPendingWrites(NET_StreamSocke
790789
* to calling NET_GetStreamSocketPendingWrites).
791790
*
792791
* If you don't want your program to block, you can call
793-
* NET_GetStreamSocketPendingWrites from time to time until you get a
794-
* result <= 0.
792+
* NET_GetStreamSocketPendingWrites from time to time until you get a result
793+
* <= 0.
795794
*
796795
* If the connection has failed (remote side dropped us, or one of a million
797796
* other networking failures occurred), this function will report failure by
@@ -1077,8 +1076,8 @@ extern SDL_DECLSPEC bool SDLCALL NET_SendDatagram(NET_DatagramSocket *sock, NET_
10771076
*
10781077
* You must pass received packets to NET_DestroyDatagram when you are done
10791078
* with them. If you want to save the sender's address past this time, it is
1080-
* safe to call NET_RefAddress() on the address and hold onto the pointer,
1081-
* so long as you call NET_UnrefAddress() on it when you are done with it.
1079+
* safe to call NET_RefAddress() on the address and hold onto the pointer, so
1080+
* long as you call NET_UnrefAddress() on it when you are done with it.
10821081
*
10831082
* Since datagrams can arrive from any address or port on the network without
10841083
* prior warning, this information is available in the NET_Datagram object
@@ -1113,14 +1112,13 @@ extern SDL_DECLSPEC bool SDLCALL NET_ReceiveDatagram(NET_DatagramSocket *sock, N
11131112
/**
11141113
* Dispose of a datagram packet previously received.
11151114
*
1116-
* You must pass packets received through NET_ReceiveDatagram to this
1117-
* function when you are done with them. This will free resources used by this
1118-
* packet and unref its NET_Address.
1115+
* You must pass packets received through NET_ReceiveDatagram to this function
1116+
* when you are done with them. This will free resources used by this packet
1117+
* and unref its NET_Address.
11191118
*
11201119
* If you want to save the sender's address from the packet past this time, it
1121-
* is safe to call NET_RefAddress() on the address and hold onto its
1122-
* pointer, so long as you call NET_UnrefAddress() on it when you are done
1123-
* with it.
1120+
* is safe to call NET_RefAddress() on the address and hold onto its pointer,
1121+
* so long as you call NET_UnrefAddress() on it when you are done with it.
11241122
*
11251123
* Once you call this function, the datagram pointer becomes invalid and
11261124
* should not be used again by the app.
@@ -1209,12 +1207,12 @@ extern SDL_DECLSPEC void SDLCALL NET_DestroyDatagramSocket(NET_DatagramSocket *s
12091207
* The following things can be specified in the `vsockets` array, cast to
12101208
* `void *`:
12111209
*
1212-
* - NET_Server (reports new input when a connection is ready to be
1213-
* accepted with NET_AcceptClient())
1210+
* - NET_Server (reports new input when a connection is ready to be accepted
1211+
* with NET_AcceptClient())
12141212
* - NET_StreamSocket (reports new input when the remote end has sent more
12151213
* bytes of data to be read with NET_ReadFromStreamSocket).
1216-
* - NET_DatagramSocket (reports new input when a new packet arrives that
1217-
* can be read with NET_ReceiveDatagram).
1214+
* - NET_DatagramSocket (reports new input when a new packet arrives that can
1215+
* be read with NET_ReceiveDatagram).
12181216
*
12191217
* This function takes a timeout value, represented in milliseconds, of how
12201218
* long to wait for resolution to complete. Specifying a timeout of -1

0 commit comments

Comments
 (0)