This wiki is out of date, use the continuation of this wiki instead

NET Listen

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:07, 14 April 2007 (edit)
Sandman (Talk | contribs)
m (Example)
← Previous diff
Current revision (22:46, 12 September 2007) (edit) (undo)
Sandman (Talk | contribs)
m
 
(6 intermediate revisions not shown.)
Line 1: Line 1:
[[Category:functions]] [[Category:functions]]
[[Category:networkdll]] [[Category:networkdll]]
 +[[Category:dll]]
-==Definition==+[[Functioncategory:Networkdll|'''Up to Network.DLL Functions''']]
 +----
-'''INT''' NET_Listen ( '''WORD''' port , ['''BYTE''' consolereports] ) 
-Listens on the specified port. The connections accepted will inherit certain variables from the listenport they were connected on. These variables are consolereports and separator.<br />+==Definition==
 +'''INT''' NET_Listen ( <'''WORD''' port> , [<'''BYTE''' consolereports>] )
 +Opens a listenconnection on a certain port. The connections accepted will inherit certain variables from the listenport they were connected on. These variables are consolereports and separator.
== Parameters == == Parameters ==
- 
{| {|
-| '''WORD''' port || The port on which to listen.+| '''WORD''' port || - The port on which to listen.
|- |-
-| ['''BYTE''' consolereports] || Specifies if there will be console reports for this connection (like messages) (true/false)+| ['''BYTE''' consolereports] || - [[true]]/[[false]]: specifies whether there will be console reports for this connection (like messages).
|} |}
- 
== Returns == == Returns ==
- +'''INT''' : Connection identifier.
-INT : [[NET_ERRORCODES|Network.DLL Errorcode]]+
{| {|
-| NET_ERROR_INVALIDSOCKETSET || The socketset is invalid.+| NET_ERROR_INVALIDSOCKETSET || - The socketset is invalid.
|- |-
-| NET_ERROR_SOCKETSETINACTIVE || The socketset is inactive.+| NET_ERROR_SOCKETSETINACTIVE || - The socketset is inactive.
|- |-
-| NET_ERROR_INVALIDPORTNUMBER || The portnumber is invalid (<0 or >65535).+| NET_ERROR_INVALIDPORTNUMBER || - The portnumber is invalid (<0 or >65535).
|- |-
-| NET_ERROR_INVALIDTYPE || The type specified is invalid.+| NET_ERROR_INVALIDTYPE || - The type specified is invalid.
|- |-
-| NET_ERROR_TOOMANYCONNS || There are too many connections+| NET_ERROR_TOOMANYCONNS || - There are too many connections
|- |-
-| NET_ERROR_RESOLVINGHOST || Could not resolve host.+| NET_ERROR_RESOLVINGHOST || - Could not resolve host.
|- |-
-| NET_ERROR_LISTENINGONCONN || Could not listen on connection.+| NET_ERROR_LISTENINGONCONN || - Could not listen on connection.
|- |-
-| NET_ERROR_ADDINGSOCKET || Could not add socket to socketset.+| NET_ERROR_ADDINGSOCKET || - Could not add socket to socketset.
|- |-
-| 0 - n || Connection identifier. (Where n is the number of maximum allowed connections)+| 0 - n || - Connection identifier. (Where n is the number of maximum allowed connections)
|} |}
- 
== Example == == Example ==
- 
<pre> <pre>
Program example; Program example;
Line 49: Line 47:
Begin Begin
- NET_Init(0,10,1);+ NET_Init(0,10,1);
- NET_Listen(4555,true);+ NET_Listen(4555,true);
- Loop+ Loop
- frame;+ frame;
- End+ End
End End
</pre> </pre>
 +
 +{{Netfuncbox}}

Current revision

Up to Network.DLL Functions



Contents

[edit] Definition

INT NET_Listen ( <WORD port> , [<BYTE consolereports>] )

Opens a listenconnection on a certain port. The connections accepted will inherit certain variables from the listenport they were connected on. These variables are consolereports and separator.

[edit] Parameters

WORD port - The port on which to listen.
[BYTE consolereports] - true/false: specifies whether there will be console reports for this connection (like messages).

[edit] Returns

INT : Connection identifier.

NET_ERROR_INVALIDSOCKETSET - The socketset is invalid.
NET_ERROR_SOCKETSETINACTIVE - The socketset is inactive.
NET_ERROR_INVALIDPORTNUMBER - The portnumber is invalid (<0 or >65535).
NET_ERROR_INVALIDTYPE - The type specified is invalid.
NET_ERROR_TOOMANYCONNS - There are too many connections
NET_ERROR_RESOLVINGHOST - Could not resolve host.
NET_ERROR_LISTENINGONCONN - Could not listen on connection.
NET_ERROR_ADDINGSOCKET - Could not add socket to socketset.
0 - n - Connection identifier. (Where n is the number of maximum allowed connections)

[edit] Example

Program example;
    include "Network.fh";
Begin

    NET_Init(0,10,1);
    NET_Listen(4555,true);
   
    Loop
        frame;
    End

End


Network.DLL Functions
Global NET_Init() • NET_Quit() • NET_Version() • NET_IntVersion() • NET_About() • NET_GetError() • NET_Stat_Buffer() • NET_IntToIP() • NET_IPToInt()
Connections NET_Connect() • NET_Listen() • NET_Disconnect() • NET_DisconnectAll()
Connection NET_Resolve() • NET_Hostname() • NET_IPAddress() • NET_Port() • NET_Separator() • NET_GetSeparator() • NET_GetSeparatorLength()
Transfer NET_Recv() • NET_RecvFile() • NET_RecvGraph() • NET_RecvVar() • NET_Send() • NET_SendFile() • NET_SendGraph() • NET_SendRN() • NET_SendVar()
Personal tools