server help

Blitz3D Forums/Blitz3D Beginners Area/server help

malicnite(Posted 2005) [#1]
when writing this code createTCPserver(8080). does this have to be 8080 and what does 8080 do is it wise to change it.


SheepOnMintSauce(Posted 2005) [#2]
I imagine it's the port it will use to create the server on, so I suppose it'd be ok to change it to another port.


jfk EO-11110(Posted 2005) [#3]
it may be any port between 1 and 65534, but you should

- don't use a common service port, such as FPT, SMTP etc.
- don't use a port from 1024 to about 200 because browsers want to use them for their connections
- don't use a part that is known to b used by trojans and is therefor blocked by many firewalls and routers

Ports 80,1080 and 8080 are common HTTP server ports. Have a look at some port lists to see what's most useful for you, eg:.

http://www.iss.net/security_center/advice/Exploits/Ports/


malicnite(Posted 2005) [#4]
thanks for the help ill look in to it. oh if i use a port as another server say napster will they mess up each other.


Gabriel(Posted 2005) [#5]
oh if i use a port as another server say napster will they mess up each other.


Yes, of course.


malicnite(Posted 2005) [#6]
so y does everyone use 8080 wouldnt that mess up alot of data. and if i have 2 vars to send do i have to write to different writestrings codes or just comma them.

like
writestring mainsrv, high$, low$
or
writestring mainsrv, high$
writestring mainsrv, low$


DH(Posted 2005) [#7]
so y does everyone use 8080 wouldnt that mess up alot of data.


It depends on what your doing. Some people want to write a web server, web pages access port 80, and in some cases 8080, so you would want a server to respond to that port.

In your case, just pick a port, do a google search on it, if you dont find alot of results (or bareable results), than use the port.

and if i have 2 vars to send do i have to write to different writestrings codes or just comma them.


Seperate writes must be made. Think of it as a buffer. You send stuff into the buffer and it gets sent as blitz sees fit.

On the recieving end, the data will pile up (buffer). So before you read data from the stream, check it for a EOF first to make sure it isnt empty.


malicnite(Posted 2005) [#8]
what about the end of file. if its just a small var it does not matter right. and i new and old to this. i used bb long time ago and got b3d now. it has a lot now then what it did.


DH(Posted 2005) [#9]
Its up to you really...

readavail(stream) will tell you how many bytes have arrived on that stream. In the case of a string, if thats all you send is strings, then i guess you can keep reading them from the stream until your heart is content. If you send ints, or bytes at times, it would be best to send some sort of byte first to tell what type of data is coming in next.