- This wiki is out of date, use the continuation of this wiki instead
 
NET Connect
From FenixWiki
(Difference between revisions)
												
			
			| Revision as of 22:58, 15 April 2007 (edit) Sandman (Talk | contribs) m ← Previous diff  | 
				Revision as of 14:49, 24 July 2007 (edit) (undo) Sandman (Talk | contribs) m Next diff →  | 
			||
| Line 2: | Line 2: | ||
| [[Category:networkdllfunctions]] | [[Category:networkdllfunctions]] | ||
| - | + | [[networkdllfunctions|'''Up to Network.DLL Functions''']] | |
| + | ---- | ||
| + | |||
| + | ==Definition== | ||
| '''INT''' NET_Connect ( '''STRING''' address , '''WORD''' port , ['''BYTE''' consolereports] ) | '''INT''' NET_Connect ( '''STRING''' address , '''WORD''' port , ['''BYTE''' consolereports] ) | ||
| - | Opens a connection to the specified address on the specified port | + | Opens a connection to the specified address on the specified port. | 
| - | + | ||
| + | Also called [[NET_Open]](). | ||
| == Parameters == | == Parameters == | ||
| - | |||
| {| | {| | ||
| - | | '''STRING''' address || The address to which will be connected. | + | | '''STRING''' address || - The address to which will be connected. | 
| |- | |- | ||
| - | | '''WORD''' port || The port on which will be connected. | + | | '''WORD''' port || - The port on which will be connected. | 
| |- | |- | ||
| - | | ['''BYTE''' consolereports] || Specifies if there will be console reports for this connection (like messages) (true/false) | + | | ['''BYTE''' consolereports] || - Specifies if there will be console reports for this connection (like messages) (true/false) | 
| |} | |} | ||
| - | |||
| == Returns == | == Returns == | ||
| - | |||
| INT : [[NET_ERRORCODES|Network.DLL Errorcode]] | 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_CONNECTING || Could not connect. | + | | NET_ERROR_CONNECTING || - Could not connect. | 
| |- | |- | ||
| - | | 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; | ||
Revision as of 14:49, 24 July 2007
Contents | 
Definition
INT NET_Connect ( STRING address , WORD port , [BYTE consolereports] )
Opens a connection to the specified address on the specified port.
Also called NET_Open().
Parameters
| STRING address | - The address to which will be connected. | 
| WORD port | - The port on which will be connected. | 
| [BYTE consolereports] | - Specifies if there will be console reports for this connection (like messages) (true/false) | 
Returns
INT : Network.DLL Errorcode
| 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_CONNECTING | - Could not connect. | 
| NET_ERROR_ADDINGSOCKET | - Could not add socket to socketset. | 
| 0 - n | - Connection identifier. (Where n is the number of maximum allowed connections) | 
Example
Program example;
    include "Network.fh";
Begin
    NET_Init(0,10,1);
    NET_Connect("www.google.com",80,true);
   
    Loop
        frame;
    End
End
						
			
		