[futurebasic] Re: [FB] Raw Resources & TCP Streams

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 1999 : Group Archive : Group : All Groups

From: Greg_Neagle@...
Date: Sun, 16 May 1999 13:32:14 -0700
On 5/15/99 at 9:25 AM, Sean wrote:

:Also, now that I have a way to open raw resources, I resumed work on my 
:communications program. For file transfers, the client needs to open 
:another connection to (current port + 1). So if the client is connected 
:to x.x.x.x:5500, file transfers are done on x.x.x.x:5501. I am using the 
:"TCP Demo" source code for my program. I don't know how to open more than 
:one simultaneous connection using that code.

The demo code defines a single global to keep track of a single connection:

DIM gTCPcon.TCPconnectionType

You'll need to keep track of two connections, so you could instead use

DIM gTCPcon1.TCPconnectionType
DIM gTCPcon2.TCPconnectionType

or you could use an array of TCPconnectionTypes, or you could create a linked
list.

You will also need to modify many of the functions in the TCP-DNR Demo.MAIN
file if you are using them, since they are hard-coded to use the Demo's
globals.  The functions in TCP-DNR.INCL should need no modifications to be
usable with mulitple connections, as they all require a pointer to a
TCPconnectionType for their data.


- BulkRate: the FirstClass offline reader for Macintosh