| CBBS Server v1.0 - Overview | History | Features | Screenshots | Technology | FAQ | ||||
|
History
This project not only taught me how to implement network communications via TCP and MySQL database
connectivity, but also how to write a complete message base system which utilizes a line-based editor subsystem for writing and
editing messages and how to implement Xmodem file transfers for
supporting uploading and downloading files to and from the file libraries. ;)
Originally, this project started out simply as a proof-of-concept project. I always wanted to write my
own BBS emulation software in Java, after having written numerous client-server
applications in Java in the past for various projects.
Normally, server applications written
in Java use the in.readLine() method to get the text line entered on the client terminal after the [ENTER]
key is pressed. So, I needed to modify the read routine to listen for each key pressed instead,
similar to how characters are read into a buffer of a serial communications modem one at a time.
I started out writing a simple EchoKeyServer
console server application which printed out the ASCII value of each key pressed (received from the client
terminal) on the client side. (The code is shown on the right)
This worked. However, PETSCII emulation displays characters
in uppercase that should be lowercase on a standard ASCII compliant terminal emulation program, such
as telnet, so I had to write a translation routine that
switches the case of characters (A-Z and a-z).
View the PETSCII emulation specification.
|
The code snippet that started the ball rolling is shown below. This example creates
a TCP server socket on the specified port, which listens for an incoming
client connection. After a connection is made to the server, I/O streams
are created for the client socket accepted. The while loop routine reads each
key pressed, echos the value back to the client, and prints out the code on
the server console screen. This demo does not support multiple connections and
exits after the client disconnects. However, it was and still is very useful for
testing for and learning about PETSCII emulation concepts, since PETSCII codes
instead of ASCII codes are printed out on the server screen when CGTerm is
used to connect to it instead of a standard telnet terminal.
|
|||