[Gambas-user] Multiple TCP server sockets
Jose J. Rodriguez
joe1962 at ...626...
Thu Feb 19 17:33:03 CET 2009
On 2/19/09, Benoît Minisini <gambas at ...1...> wrote:
> > On 2/17/09, Benoît Minisini <gambas at ...1...> wrote:
> > > > Is there any way to get different TCP server objects with different
> > > > ports to use a different socket object for read? I am trying to port
> > > > my VB6 multiport communications server application to Gambas2 and (I
> > > > think) I need something like that to get it to work.
> > > >
> > > I would say yes. I see nothing that prevents from creating several
> > > SocketServer objects.
> >
> > That is not the issue, you can do that, but they all use the same
> > socket_read sub. Or I my missing something here?
> >
> Hem, you are right, I didn't notice.
>
> Internallly the Socket object knows which ServerSocket created it, but you
> don't have any access to it!
>
> As a workaround, I think you can use the port number to make the difference.
>
I will look into that in the meantime.
>
> Maybe I will make a "Server" property in the Socket class to get the
> ServerSocket object creator.
>
> And I can add an optional argument to the Accep() method to define the event
> name of the created socket.
>
That would be great! Thanks.
Regards,
Joe1962
More information about the User
mailing list