Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_spxsend( <nspxcn>, <cbuffer> ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_SPXSEND( <nSPXCN>, <cBuffer> )


Parameters

<nSPXCN>
SPX connection number. See N_SPXCONNECT().

<cBuffer>
Data buffer to send, up to 512 bytes. While the recipient will be able 
to tell who you are by getting your network address from N_WHOAREYOU(), 
a much more efficient method is to include your identification in the 
message packet itself or in the first packet sent after a connection 
has been established.


Returns

Logical true if the message was received.

Logical false if the message was not received. Common reasons for 
failure are that the address was invalid, the target station is not 
logged in, the target station is not .listening," or that SPX is not 
loaded at one of the stations.


Description

This function enables network communication using SPX (Sequenced Packet 
eXchange), an enhancement of the IPX protocol. IPX merely sends data 
out across the network; after a message is dispatched, its 
reponsibility ends. SPX, on the other hand, actually monitors data 
transmissions, ensuring that they reach their intended destinations and 
that they arrive intact.

The cost for this enhanced service is extra time and trouble. First, 
SPX communication, because it adds an extra layer, is slower than IPX 
alone. Second, before you begin an SPX session you must establish a 
connection with the receiving station, and at the end of the session 
you must disconnect.

Begin an SPX session by calling N_SPXCONNECT() to obtain a connection 
number:

nConnection = 0
DO WHILE nConnection = 0
   nConnection = N_SPXCONNECT(NETADDR('WATSON'))
ENDDO

Once you have established a connection, you are ready to transmit data. 
To do this, pass the connection number obtained from N_SPXCONNECT() as 
the first argument for N_SPXSEND(), and the message buffer as the 
second argument.

Example

cBuffer = 'Watson come here, I need you.'
N_SPXSEND(nConnection, cBuffer)
N_SPXDISCONNECT(nConnection)



See Also: N_SPXCONNECT() N_SPXRECV()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson