Page 1 of 1

Multi Network Servers?

Posted: Thu Jul 31, 2003 7:06 am
by AngelSoul
Result = CreateNetworkServer(4444)
Result = CreateNetworkServer(5555)
Result = CreateNetworkServer(6666)

if i only want to shutdown listening on port 5555 how can i do that since CloseNetworkServer() has no parameter for it??

Posted: Thu Jul 31, 2003 7:27 am
by Ombres
Syntax

Result = CreateNetworkServer(Port)
Description

Create a new network server on the local computer at the specified port. Port values can range from 6000 to 7000 (this is a recommended area space, but it can go from 0 to 16000 in reality). Any number of servers can run simultaneously on the same computer but not with the same port number. However, there can only one Server be started from every Pb program. If the 'Result' is 0, the server can't be created (port in use), otherwise the server has been correctly created and is ready to use.

Posted: Thu Jul 31, 2003 7:40 am
by AngelSoul
However, there can only one Server be started from every Pb program.
This is not quite accurate, i did a netstat and ports 4444/5555/6666 were in listening mode. In theory it works fine, it's only if i want to shutdown one of them. To be more precise:

I'm currently doing an IRC engine and i require port 113 for idendt requests and another one for DCC. Looks like i'll have to decide which feature to throw out.. the ident or DCC?

See my dilema here?

Posted: Thu Jul 31, 2003 8:08 am
by Karbon
Let me clear this up :-)
Syntax

Result = CreateNetworkServer(Port)
Description

Create a new network server on the local computer at the specified port. Port values can range from 6000 to 7000 (this is a recommended area space, but it can go from 0 to 16000 in reality). Any number of servers can run simultaneously on the same computer but not with the same port number. However, there can only one Server be started from every Pb program. If the 'Result' is 0, the server can't be created (port in use), otherwise the server has been correctly created and is ready to use.
Note the bold part...

Posted: Thu Jul 31, 2003 5:29 pm
by aszid
hmm... well it sounds like he noticed that the first time... however in practice he was able to actually open more than one. of course.. i could be wrong, that's just what it sounded like to me.

i do think it would be a worthy request to put into the request section though ~_^

i myself am working on a project that could definantly benefit from the ability to have more than one server running through the same app..

@AngelSoul, just a few ideas...

maybe you could make more than one EXE, and have them communicate between each other, then it would only be one server per app, but the combined apps could work as a whole....
i haven't made any DLL's yet.. so i can't speak from experience, but perhaps you could make a server from DLL's, and just manipulate them through the main EXE....

anyhow, just a few thoughts.

*editted for bad grammar, cauze me no good at good gramar*

Posted: Thu Jul 31, 2003 6:57 pm
by Pupil
The fact that you can open several servers doesn't mean that you're meant to. Why it's mentioned in the manual is because there's no way with the current commandset to tell wich port the incomming data is received on and i don't even know if PB just receives data from the latest opened server port or from all of them.

Posted: Thu Jul 31, 2003 8:19 pm
by Karbon
I was only joking with my post.. By all means, put this in the feature requests forum!

Posted: Fri Aug 01, 2003 6:36 am
by AngelSoul
Thanks aszid for the suggestion, i thought about it right after but i realized that my problem is virtually solved since ident requests are done in the beginning of the connection only. After that i simply re-initialize a new server port for DCCs.

I'm sure this will be resolved in a future release (hopefully) and UDP support?

Anyway i'm celebrating my 4th day or PB programming :>

Posted: Fri Aug 01, 2003 12:19 pm
by Kale
see:

viewtopic.php?t=6344

for UDP Support :)

Posted: Sat Jul 10, 2004 4:18 am
by Shannara
*bump* maybe this can be added?

Posted: Sun Apr 24, 2005 8:27 am
by Shannara
Another bump of course .. can we expect a more filled net library in PB4?

Also, Ident would be used all throughout the lifetime of the irc client if the client connects to more then one server at any given time (like mine).

Right now I created a dll with tailbite to take care of the ident server. However, I cannot do that in Linux since Tailbite does not work in Linux. And that is the only thing that is preventing the app from running in linux.