TSocket, TSocketStream (source code)

BlitzMax Forums/BlitzMax Programming/TSocket, TSocketStream (source code)

Trader3564(Posted 2008) [#1]
Howdy,

When reviewing the docs for TSocket and TSocketStream (and probably everything) it has in the upper right top a link called "Source" when you click it you can see the source code which Mark himself has written.

Now, we are working on a fast networking package, the question im having is, Would it make any difference if we choose to use either TSocketStream, TSocket, or even abuse the source and make our own type, besides functionality? Would this speed things up? or would we just lose on functionality? (the lower we go) and not even gain a bit of speed?

Additionaly, compiled modules, are these faster than BMX project code?

So basicly, what im asking is, if we would base a networking package on top of TSocketStream or TSocket or something, would that be slower than for when we would make our own type of the source? Or would that be too minimal to even consider?


AlexO(Posted 2008) [#2]
I've been using TSocketStream as the base for my networking lib and it's helped so far encapsulation-wise. Allows me to implement features such as reliability over udp, encryption, different reliability channels, etc w/o the upper layer code even being aware of it. I can't comment on performance though as it is still too early in development and I imagine there's already several areas that could be optimized on my part.

From my understanding, Blitzmax's socket API is already pretty thin, pretty much just going straight to lower-layer C calls then to system calls. I doubt you'll incur much of a performance hit just sticking to TSockets. Streams are just wrappers around data, but you could run some performance tests if you were really concerned about their impact.


plash(Posted 2008) [#3]
Additionaly, compiled modules, are these faster than BMX project code?
Absolutely not. Everything goes to the same place when you compile your program.


Trader3564(Posted 2008) [#4]
Ok. thanks for the info's guys :)