Networking
Functions
Accept All New Connections
Accept new connections for all servers.
Return Type: Boolean
Signatures:
Accept New Connection
Accept new connections for a server
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Boolean
Signatures:
Broadcast Message
Broadcast Message
Broadcast a message to all connections of a server.
Parameters:
Name | Type | Description |
---|---|---|
a_msg | String | The message to send |
svr | Server Socket | The server to send the message to. |
Signatures:
Broadcast Message
Broadcase a message to all of the connections.
Parameters:
Name | Type | Description |
---|---|---|
a_msg | String | The message to send |
Signatures:
Broadcast Message
Broadcast a message to all connections of a server.
Parameters:
Name | Type | Description |
---|---|---|
a_msg | String | The message to send |
name | String | The name of the server to send the message to. |
Signatures:
Check Network Activity
Check network activity, looking for new connections and messages.
Signatures:
Clear Messages
Clear Messages
Clear all of the messages from a server or connection with the supplied name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection or the server to clear. |
Signatures:
Clear Messages
Clear all of the messages from a connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection |
Signatures:
Clear Messages
Clear all of the messages from a server.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | The server to clear the messages from |
Signatures:
Close All Connections
Close all of the connections you have opened. This does not close connections to servers.
Signatures:
Close All Servers
Close all of the servers that are currently open.
Signatures:
Close Connection
Close Connection
Close the connection
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection to close |
Return Type: Boolean
Signatures:
Close Connection
Close the connection
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection to close |
Return Type: Boolean
Signatures:
Close Message
Closes the message.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to close |
Signatures:
Close Server
Close Server
Closes the server with the indicated name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to close |
Return Type: Boolean
Signatures:
Close Server
Closes the server, all connections with clients will be shut and the port will be closed.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | The server to close |
Return Type: Boolean
Signatures:
Connection Count
Connection Count
Returns the number of clients connected to a server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to check |
Return Type: Unsigned Integer
Signatures:
Connection Count
Returns the number of clients connected to a server.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Unsigned Integer
Signatures:
Connection Ip
Connection Ip
Gets the ip address of the passed in connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection |
Return Type: Unsigned Integer
Signatures:
Connection Ip
Gets the ip address of the connection with the supplied name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection |
Return Type: Unsigned Integer
Signatures:
Connection Named
Fetch the connection with the indicated name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection to fetch |
Return Type: Connection
Signatures:
Connection Port
Connection Port
Gets the port of the connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection |
Return Type: undefined
Signatures:
Connection Port
Gets the part of the connection.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection |
Return Type: undefined
Signatures:
Create Server
Create Server
Creates a new TCP server that can accept connections from other programs.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name used to access the Server in splashkit |
port | unsigned short | The port that clients will use to connect to the server |
Return Type: Server Socket
Signatures:
Create Server
Creates a new server that can accept connections from other programs.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name used to access the Server in splashkit |
port | unsigned short | The port that clients will use to connect to the server |
protocol | Connection Type | The protocol used by the server |
Return Type: Server Socket
Signatures:
Dec To Hex
Converts the supplied decimal integer into it’s hexadecimal representation. e.g. 0x7F000001 from 2130706433
Parameters:
Name | Type | Description |
---|---|---|
a_dec | unsigned int | decimal to be converted to a hexadecimal number string |
Return Type: String
Usage:
See Example Code
Signatures:
Fetch New Connection
Get the oldest new connections made to the server, and reduces the new connection count by 1.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Connection
Signatures:
Has Connection
Does the connection with the supplied name exist?
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection to check. |
Return Type: Boolean
Signatures:
Has Messages
Has Messages
Checks if there are any messages waiting to be read.
Return Type: Boolean
Signatures:
Has Messages
Checks if a connection has messages waiting to be read.
Parameters:
Name | Type | Description |
---|---|---|
con | Connection | The connection |
Return Type: Boolean
Signatures:
Has Messages
Checks if a server or connection has any messages.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server or connection to check. |
Return Type: Boolean
Signatures:
Has Messages
Checks if a server has any messages waiting to be read.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | The server to check |
Return Type: Boolean
Signatures:
Has New Connections
Checks if any of the servers have new connections.
Return Type: Boolean
Signatures:
Has Server
Checks if there is a server with the indicated name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to check |
Return Type: Boolean
Signatures:
Hex Str To Ipv4
The supplied hexadecimal string is translated into ipv4 standard address string. Function handles hex strings starting with or without 0x. e.g. 127.0.0.1 from 0x7F000001
Parameters:
Name | Type | Description |
---|---|---|
a_hex | String | hexadecimal ipv4 string to convert |
Return Type: String
Signatures:
Hex To Dec String
The supplied hexadecimal string is converted into it’s decimal representation e.g. 7F into 127
Parameters:
Name | Type | Description |
---|---|---|
a_hex | String | hexadecimal string to convert |
Return Type: String
Usage:
See Example Code
Signatures:
Ipv4 To Dec
Encodes the supplied ipv4 address string (in format X.X.X.X) into a single integer e.g. 127.0.0.1 into 2130706433
Parameters:
Name | Type | Description |
---|---|---|
a_ip | String | ipv4 address to encode |
Return Type: Unsigned Integer
Usage:
See Example Code
Signatures:
Ipv4 To Hex
Converts an ipv4 address into it’s hexadecimal representation e.g. 0x7F000001 from 127.0.0.1
Parameters:
Name | Type | Description |
---|---|---|
a_ip | String | ip address to convert |
Return Type: String
Usage:
See Example Code
Signatures:
Ipv4 To Str
Decodes the supplied unsigned 32 bit integer into it’s ipv4 address form e.g. 2130706433 into 127.0.0.1
Parameters:
Name | Type | Description |
---|---|---|
ip | unsigned int | integer to be decoded |
Return Type: String
Signatures:
Is Connection Open
Is Connection Open
Checks if the connection currently is open.
Parameters:
Name | Type | Description |
---|---|---|
con | Connection | The connection |
Return Type: Boolean
Signatures:
Is Connection Open
Checks if the connection with the supplied name currently is open.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection |
Return Type: Boolean
Signatures:
Last Connection
Last Connection
Gets the last client that connected to a server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to check |
Return Type: Connection
Signatures:
Last Connection
Gets the last client that connected to a server.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Connection
Signatures:
Message Connection
Returns the connection that sent a message.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message |
Return Type: Connection
Signatures:
Message Count
Message Count
Returns the number of messages on a server.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | The server to check |
Return Type: Unsigned Integer
Signatures:
Message Count
Returns the number of messages on a connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection |
Return Type: Unsigned Integer
Signatures:
Message Count
Returns the number of messages on a server or connection.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server or connection |
Return Type: Unsigned Integer
Signatures:
Message Data
Gets the body of a message as a string.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to check |
Return Type: String
Signatures:
Message Data Bytes
Gets the body of a message as a list of bytes.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to check |
Return Type: Vector
Signatures:
Message Host
Returns the host who made the message.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to check |
Return Type: String
Signatures:
Message Port
Returns the port used to send a message.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to check |
Return Type: undefined
Signatures:
Message Protocol
Returns the protocol used to send a message.
Parameters:
Name | Type | Description |
---|---|---|
msg | Message | The message to check |
Return Type: Connection Type
Signatures:
My Ip
Returns the ipv4 string of the localhost loopback for the current computer.
Return Type: String
Signatures:
Name For Connection
Returns the name SplashKit would use for a connection made to a server from a host to a port.
Parameters:
Name | Type | Description |
---|---|---|
host | String | The host name |
port | unsigned int | The port |
Return Type: String
Signatures:
New Connection Count
Get the number of new connections made to the server. The count will increase as the server accepts new connections. The count decreases each time you fetch a new connection, or can be set to 0 if you reset the new connection count.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Integer
Signatures:
Open Connection
Open Connection
Opens a TCP connection to a server using the supplied details.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name for the connection |
host | String | The address of the server |
port | unsigned short | The server’s port |
Return Type: Connection
Signatures:
Open Connection
Opens a connection to a server using the supplied details.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name for the connection |
host | String | The address of the server |
port | unsigned short | The server’s port |
protocol | Connection Type | The protocol used to connect to the server |
Return Type: Connection
Signatures:
Read Message
Read Message
Read a message from the network (from a server or connection).
Return Type: Message
Signatures:
Read Message
Reads the first message from the connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | A connection |
Return Type: Message
Signatures:
Read Message
Reads the first message from a connection or server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of a connection or server |
Return Type: Message
Signatures:
Read Message
Reads the first message from the server.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | A server |
Return Type: Message
Signatures:
Read Message Data
Read Message Data
Read message data from a connection or server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection or server |
Return Type: String
Signatures:
Read Message Data
Read message data from a connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection |
Return Type: String
Signatures:
Read Message Data
Read message data from a server.
Parameters:
Name | Type | Description |
---|---|---|
svr | Server Socket | The server |
Return Type: String
Signatures:
Reconnect
Reconnect
Attempt to reconnect the connection.
Parameters:
Name | Type | Description |
---|---|---|
a_connection | Connection | The connection to reconnect |
Signatures:
Reconnect
Attempt to reconnect the connection.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection to reconnect. |
Signatures:
Release All Connections
Close and release the resources used by all of the connections.
Signatures:
Reset New Connection Count
Allows you to reset the new connection count to 0. (The connections are kept)
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Signatures:
Retrieve Connection
Retrieve Connection
Get a connection from the server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server |
idx | Integer | The index of the connection |
Return Type: Connection
Signatures:
Retrieve Connection
Get a connection from the server.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server |
idx | Integer | The index of the connection |
Return Type: Connection
Signatures:
Send Message To
Send Message To
Send a message to the connection.
Parameters:
Name | Type | Description |
---|---|---|
a_msg | String | The message to send |
a_connection | Connection | The connection to send the message to |
Return Type: Boolean
Signatures:
Send Message To
Send a message to the connection with the given name.
Parameters:
Name | Type | Description |
---|---|---|
a_msg | String | The message to send |
name | String | The name of the connection to send the message to |
Return Type: Boolean
Signatures:
Server Has New Connection
Server Has New Connection
Checks of there are new connections waiting for a server.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to check |
Return Type: Boolean
Signatures:
Server Has New Connection
Checks of there are new connections waiting for a server.
Parameters:
Name | Type | Description |
---|---|---|
server | Server Socket | The server to check |
Return Type: Boolean
Signatures:
Server Named
Gets the server with the indicated name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the server to get |
Return Type: Server Socket
Signatures:
Set Udp Packet Size
Change the size of the UDP packets.
Parameters:
Name | Type | Description |
---|---|---|
udp_packet_size | unsigned int | The new packet size. |
Signatures:
Udp Packet Size
Returns the size SplashKit is using for UDP packets.
Return Type: Unsigned Integer
Signatures:
Download Bitmap
Download an image from a web server and load it into SplashKit so that you can use it.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the bitmap resource when it is loaded |
url | String | The URL path to the image resoure |
port | unsigned short | The port to connect to on the server |
Return Type: Bitmap
Signatures:
Download Font
Download a font from a web server and load it into SplashKit so that you can use it.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the font resource when it is loaded |
url | String | The URL path to the font resoure |
port | unsigned short | The port to connect to on the server |
Return Type: Font
Signatures:
Download Music
Download a music file from a web server and load it into SplashKit so that you can use it.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the music resource when it is loaded |
url | String | The URL path to the music resoure |
port | unsigned short | The port to connect to on the server |
Return Type: Music
Signatures:
Download Sound Effect
Download a sound effect from a web server and load it into SplashKit so that you can use it.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the sound effect resource when it is loaded |
url | String | The URL path to the sound effect resoure |
port | unsigned short | The port to connect to on the server |
Return Type: Sound Effect
Signatures:
Free Response
Free the response resource.
Parameters:
Name | Type | Description |
---|---|---|
response | Http Response | The response to free |
Usage:
Signatures:
Http Get
Make a get request to access a resource on the internet.
Parameters:
Name | Type | Description |
---|---|---|
url | String | The path to the resource, for example http://splashkit.io |
port | unsigned short | The port on the server (80 for http, 443 for https) |
Return Type: Http Response
Usage:
Signatures:
Http Post
Http Post
Post the supplied information to the indicated url with the given headers.
Parameters:
Name | Type | Description |
---|---|---|
url | String | The url of the server to post the data to |
port | unsigned short | The port to connect to on the server |
body | String | The body of the message to post |
headers | Vector | The headers of the request |
Return Type: Http Response
Usage:
Signatures:
Http Post
Post the supplied information to the indicated url.
Parameters:
Name | Type | Description |
---|---|---|
url | String | The url of the server to post the data to |
port | unsigned short | The port to connect to on the server |
body | String | The body of the message to post |
Return Type: Http Response
Signatures:
Http Response To String
Read the HTTP response and convert it to text
Parameters:
Name | Type | Description |
---|---|---|
response | Http Response | The response from the server |
Return Type: String
Usage:
Signatures:
Save Response To File
Save the HTTP response downloaded into a file.
Parameters:
Name | Type | Description |
---|---|---|
response | Http Response | The response from the server |
path | String | The path to the file where the response should be saved |
Signatures:
Has Incoming Requests
Returns true if the given web_sever
has pending requests.
Parameters:
Name | Type | Description |
---|---|---|
server | Web Server | The Web Server to check for waiting requests. |
Return Type: Boolean
Signatures:
Is Delete Request For
Checks if a request wants to delete a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Is Get Request For
Checks if a request wants to get a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Usage:
Signatures:
Is Options Request For
Checks if a request wants to check options for given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Is Post Request For
Checks if a request wants to create (post) a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Is Put Request For
Checks if a request wants to update (put) a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Is Request For
Checks if a request is after a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
method | Http Method | The kind of request |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Is Trace Request For
Checks if a request wants to trace a given resource.
Parameters:
Name | Type | Description |
---|---|---|
request | Http Request | The request to check |
path | String | The resource/route path |
Return Type: Boolean
Signatures:
Next Web Request
Returns the next request on a given Web Server
instance
Parameters:
Name | Type | Description |
---|---|---|
server | Web Server | The Web Server to get the Http Request from. |
Return Type: Http Request
Usage:
Signatures:
Request Body
Returns the body of the request.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
Return Type: String
Signatures:
Request Has Query Parameter
Returns true if the parameter exists in the query string.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
name | String | The name of the parameter to check |
Return Type: Boolean
Signatures:
Request Headers
Returns the headers of the request.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
Return Type: Vector
Signatures:
Request Method
Returns the HTTP method of the client request.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
Return Type: Http Method
Signatures:
Request Query Parameter
Returns the value of a parameter from within the query string, or the supplied default if no matching parameter is found.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
name | String | The name of the parameter to fetch |
default_value | String | The value to return if the named parameter is not in the query string. |
Return Type: String
Signatures:
Request Query String
Returns the URI query string of the client request.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
Return Type: String
Signatures:
Request Uri
Returns the server URI of the client request.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | A request object. |
Return Type: String
Signatures:
Request Uri Stubs
Returns an array of strings representing each stub of the URI. For example a request sent to http://localhost:8080/names/0 returns… [“names”, “0”]
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request for retrieving URI to split into stubs. |
Return Type: Vector
Signatures:
Send Css File Response
Serves a css file to the given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request which is asking for the resource. |
filename | String | The name of the file in Resources/server |
Signatures:
Send File Response
Serves a file to the given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request which is asking for the resource. |
filename | String | The name of the file in Resources/server |
content_type | String | The type of content being send: |
Signatures:
Send Html File Response
Serves a HTML file to the given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request which is asking for the resource. |
filename | String | The name of the file in Resources/server |
Usage:
Signatures:
Send Javascript File Response
Serves a javascript file to the given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request which is asking for the resource. |
filename | String | The name of the file in Resources/server |
Signatures:
Send Response
Send Response
Sends a response with no content to a Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The Http Request to send the response to |
Signatures:
Send Response
Sends a message to a given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request to be sent. |
message | String | The message to be sent |
Usage:
Signatures:
Send Response
Sends a response code to a given Http Request
.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The Http Request to send the response to |
code | Http Status Code | The [HTTP status code](See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to be sent. |
Signatures:
Send Response
Sends a message to a given Http Request
with the specified content type.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The Http Request to send the response to |
code | Http Status Code | The [HTTP status code](See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to be sent. |
message | String | The messsage, in the form of a Http Response , to be sent. |
Signatures:
Send Response
Sends a message to a given Http Request
with the specified content type.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The Http Request to send the response to |
code | Http Status Code | The [HTTP status code](See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to be sent. |
message | String | The messsage, in the form of a Http Response , to be sent. |
content_type | String | The content type of the response. |
Signatures:
Send Response
Sends a message to a given Http Request
with the specified content type.
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The Http Request to send the response to |
code | Http Status Code | The [HTTP status code](See https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to be sent. |
message | String | The messsage, in the form of a Http Response , to be sent. |
content_type | String | The content type of the response. |
headers | Vector | The response headers |
Signatures:
Send Response
Send a JSON response to a given Http Request
Parameters:
Name | Type | Description |
---|---|---|
r | Http Request | The request the response belongs to. |
j | Json | The json to be sent. |
Signatures:
Split Uri Stubs
Returns an array of strings representing each stub of the URI. For example a request sent to http://localhost:8080/names/0 returns… [“names”, “0”]
Parameters:
Name | Type | Description |
---|---|---|
uri | String | The URI to split into stubs. |
Return Type: Vector
Signatures:
Start Web Server
Start Web Server
Creates a new web server listening for connections on port 8080.
Return Type: Web Server
Usage:
Signatures:
Start Web Server
Starts the web server on a given port number.
Parameters:
Name | Type | Description |
---|---|---|
port | unsigned short | The port number to connect through. |
Return Type: Web Server
Signatures:
Stop Web Server
Stops a given Web Server
instance.
Parameters:
Name | Type | Description |
---|---|---|
server | Web Server | The server instance to stop. |
Usage:
Signatures:
Types
Connection
A connection represents the communication channel from a client going to a server. This can be used for the client and the server to send and receive messages.
Connection Type
Constant | Value | Description |
---|---|---|
TCP | Uses the TCP protocol. SplashKit can send messages of anysize, and repackage it from you at the other end. Messagesare reliably transferred. | |
UDP | Uses the UDP protocol. SplashKit will send messages of upto 1024 bytes (by default). You need to handle packaginganything larger than this. | |
UNKNOWN | The protocol is unknown, usually due to the connectionor server being invalid or closed. |
The kind of protocol used for a server of connection.
Http Method
Constant | Value | Description |
---|---|---|
HTTP_GET_METHOD | A get method | |
HTTP_POST_METHOD | A post method | |
HTTP_PUT_METHOD | A put method | |
HTTP_DELETE_METHOD | A delete method | |
HTTP_OPTIONS_METHOD | An options method | |
HTTP_TRACE_METHOD | A trace method | |
UNKNOWN_HTTP_METHOD | A method not recognised by SplashKit |
The method token is used to indicate the kind of action to be performed on the server. See W3 specifications.
Http Request
The request contains the details of the resource the user is requesting.
Http Response
A HTTP response is a resource that comes back from a HTTP request. This
may be the text related to a web page, or the data related to a resource.
Once you have used the response, you need to make sure to call
Free Response
.
Message
A message contains data that has been transferred between a client connection and a server (or visa versa).
Server Socket
A server represents a network resource that clients can connect to. The server will receive messages from all of the client connections, and can be used to access the clients connected to the server.
Web Server
The web server is able to listen for incoming requests, and you can then provide the response.