Winsock objects and arrays. 
Author Message
 Winsock objects and arrays.

Hello,

I have a question about Winsock. I am building a client server
application. for this to work, first of all I am building a
communications object to support our
own protocols. but I have a problem with Winsock.  As far as I know ONE
SINGLE winsock control can have ONE active connection on ONE socket. but

ofcourse, it needs tobe possible to maintain multiple connecions with
multiple clients over multiple sockets (alot of multiple huh?).. I
figured an array of Winsock controls would make this possible, one for
every connection.

now here is the problem, I cant make a dynamical array of objects that
return events, becouse I cant create new objects with the NEW parameter.

anyone have any idea how I can create object arrays that return events??

or if that isnt possible, how can I maintain multiple connections with
the winsock control?

thanks in advance,

Sven Oostenbrink



Mon, 09 Sep 2002 03:00:00 GMT  
 Winsock objects and arrays.
Just Use one Winsock but make it index = 0

Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As
Long)
'get a new free Indexnumber (new)
load Winsock1(number)
If Winsock1.State <> sckClosed Then Winsock1.Close
       Winsock1.Accept (requestID)
    End If
End Sub

Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)

'Getdata
End Sub

Quote:

> Hello,

> I have a question about Winsock. I am building a client server
> application. for this to work, first of all I am building a
> communications object to support our
> own protocols. but I have a problem with Winsock.  As far as I know ONE
> SINGLE winsock control can have ONE active connection on ONE socket. but

> ofcourse, it needs tobe possible to maintain multiple connecions with
> multiple clients over multiple sockets (alot of multiple huh?).. I
> figured an array of Winsock controls would make this possible, one for
> every connection.

> now here is the problem, I cant make a dynamical array of objects that
> return events, becouse I cant create new objects with the NEW parameter.

> anyone have any idea how I can create object arrays that return events??

> or if that isnt possible, how can I maintain multiple connections with
> the winsock control?

> thanks in advance,

> Sven Oostenbrink



Mon, 09 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Winsock objects and arrays.

2. Winsock objects and arrays.

3. Object array to string array

4. How to store object to an object array?

5. Passing data arrays from object to object

6. Array passing using winsock in VB

7. Sending array with Winsock Control

8. winsock control array

9. byte arrays, winsock, and other trouble

10. Sending Array via WinSock

11. Loading Data into MultiDim Array/Sending via WinSock

12. Winsock Control Array errors.

 

 
Powered by phpBB® Forum Software