Multi Network Servers?

Everything else that doesn't fall into one of the other PB categories.
AngelSoul
User
User
Posts: 55
Joined: Tue Jul 29, 2003 9:16 am
Location: Canada

Multi Network Servers?

Post 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??
AMD 1.8 - 512mb - ATI All-In-Wonder Radeon 9000 pro - W2k Pro
BASIC programmers never die, they just return without gosub.
Ombres
New User
New User
Posts: 1
Joined: Fri Jul 25, 2003 9:06 am

Post 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.
AngelSoul
User
User
Posts: 55
Joined: Tue Jul 29, 2003 9:16 am
Location: Canada

Post 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?
AMD 1.8 - 512mb - ATI All-In-Wonder Radeon 9000 pro - W2k Pro
BASIC programmers never die, they just return without gosub.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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...
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
aszid
Enthusiast
Enthusiast
Posts: 162
Joined: Thu May 01, 2003 8:38 pm
Location: California, USA
Contact:

Post 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*
--Aszid--

Making crazy people sane, starting tomorrow.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post 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.
Last edited by Pupil on Thu Jul 31, 2003 9:47 pm, edited 1 time in total.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I was only joking with my post.. By all means, put this in the feature requests forum!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
AngelSoul
User
User
Posts: 55
Joined: Tue Jul 29, 2003 9:16 am
Location: Canada

Post 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 :>
AMD 1.8 - 512mb - ATI All-In-Wonder Radeon 9000 pro - W2k Pro
BASIC programmers never die, they just return without gosub.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

see:

viewtopic.php?t=6344

for UDP Support :)
--Kale

Image
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

*bump* maybe this can be added?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
Post Reply