You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
caseEALREADY: // A connection request is already in progress for the specified socket.
236
239
caseEBADF: // The socket argument is not a valid file descriptor.
237
240
caseEINPROGRESS: // O_NONBLOCK is set for the file descriptor for the socket and the connection cannot be immediately established; the connection shall be established asynchronously.
@@ -260,9 +263,9 @@ namespace v0
260
263
caseEIO: // An I/O error occurred whil reading from or writing to the file system.
This API version is not yet stable. Do not use this version as a protection against API change.
4
+
5
+
## What is it?
6
+
7
+
maxSocket's API is versioned.
8
+
9
+
This means as the API is improved over time we will not break your code.
10
+
11
+
The latest version will be pulled into the maxSocket namespace. That way you may chose to use the latest version and be notified via compiler errors when the API changes.
12
+
13
+
But if instead you prefer to upgrade when you are ready, you can use a specific version. In the case of v0, this is in the namespace maxSocket::v0.
14
+
15
+
However, **v0 is not yet stable**. It is likely to change.
The SocketSystem class is the starting point for all of maxSocket.
8
+
9
+
A developer starts using maxSocket by calling [CreateSocketSystem](SocketSystem_CreateSocketSystem.md).
10
+
11
+
From there, a developer may choose to resolve a host name via [ResolveHostNameUsingOSDefaults](SocketSystem_ResolveHostNameUsingOSDefaults.md) and/or
12
+
connect to an end point via [CreateSocketAndConnect](SocketSystem_CreateSocketAndConnect.md).
13
+
14
+
## Note
15
+
16
+
Even though some methods of socket communication are considered connectionless (they do not perform a handshake nor maintain state), maxSocket uses the word "connect" to mean establish a route to the end point.
17
+
18
+
So a developer would call [CreateSocketAndConnect](SocketSystem_CreateSocketAndConnect.md) even when creating a UDP socket.
This method will create a socket and connect to the spefied end point.
8
+
9
+
This is a method of [SocketSystem](SocketSystem.md).
10
+
11
+
## Note
12
+
13
+
In this context, "connect" means setup a line of communication to the end point. A protocol which is said to be connectionless (does not perform a handshake nor maintain state) such as UDP will still needs to be setup.
14
+
15
+
The actual socket communication has not yet been polished. As a consequence, this function is likely to change soon.
* This is the end point to which a connection will be established.
32
+
***Port**
33
+
* This is the port at the end point to connect to.
34
+
***Protocol**
35
+
* Specifies which protocol to connect using:
36
+
37
+
| value | Description |
38
+
| --- | --- |
39
+
| Protocol::TCP | will perform a handshake, attempt to keep messages ordered, and notify when the end point can no longer be reached. |
40
+
| Protocol::UDP | will only touch the network when instructed to but does not know if the message was received. |
41
+
42
+
***CreatedSocket**
43
+
* On success, this is populated with the socket which was created and connected.
44
+
* If this parameter previously referenced another socket, that socket will be destroyed.
45
+
46
+
## Returns
47
+
48
+
* On success, returns **CreateSocketAndConnectResults::Success**
49
+
* On error, returns:
50
+
51
+
| Value | Description |
52
+
| --- | --- |
53
+
|**CreateSocketAndConnectResults::SystemError**| when the system does not support the type of connection requested. |
54
+
|**CreateSocketAndConnectResults::NoMoreSocketDescriptorsAvailable**| when there are not enough socket descriptors left for the system fulfill the request. |
55
+
|**CreateSocketAndConnectResults::NotAuthorized**| when the process does not have permission to create the requested socket. |
56
+
|**CreateSocketAndConnectResults::OutOfMemory**| when the system does not have enough memory to fulfill the request. |
57
+
|**CreateSocketAndConnectResults::ConnectionRefused**| when the end point turned down the connection. |
58
+
|**CreateSocketAndConnectResults::TimedOut**| when the connection to the end point did not complete in time. |
59
+
|**CreateSocketAndConnectResults::NetworkUnreachable**| when the underlying network cannot be reached. |
60
+
|**CreateSocketAndConnectResults::EndPointUnreachable**| when the end point cannot be reached. |
61
+
|**CreateSocketAndConnectResults::NetworkDown**| when the underlying network has gone down. |
62
+
|**CreateSocketAndConnectResults::ConnectionResetByEndPoint**| when the underlying network has gone down. |
63
+
|**CreateSocketAndConnectResults::Interrupted**| when the connection was interrupted by a system event. |
64
+
|**CreateSocketAndConnectResults::LibraryError**| when there is an error in maxSocket's logic. Please notify us if you ever see a LibraryError. |
65
+
|**CreateSocketAndConnectResults::UnknownError**| when there is an error maxSocket is not aware of. Please notify us if you ever see an UnknownError. |
0 commit comments