Squeak Class Documentation category index | class index  
 
NebraskaServer
  category: Morphic-Remote
  superclass: Model
  subclasses:

A Nebraska server has a private world and some collection of clients. It associates a RemoteControlledHand for each client. Redraw events in the world are broadcasted to all connected clients. A Nebraska server can listen on a TCP/IP port and accept new clients. Current version has been modified so that the server serves the world in which it was launched. Other variations are certainly possible.

To start a server, execute the following code:
NebraskaServerMorph serveWorld: World

To start a client, run the following in another image:
NetworkTerminalMorph openAndConnectTo: 'servername'

Fill in your server's hostname for 'servername'. At this point, everything should be working!

Before starting a server, you can tweak these:
BufferedCanvas enabled: false.
BufferedCanvas enabled: true.

At any time you can do these:
NebraskaDebug beginStats
NebraskaDebug showStats
NebraskaDebug showStats: #delays
NebraskaDebug showStats: #bigImage
NebraskaDebug showStats: #FormEncodeTimes
NebraskaDebug killStats

NOTE: if you want to have a local view of the server, you shouldn't use the TCP connections. The problem is that the server will occasionally do a #flush, and it won't work due to single threading. The better solution is to use a LoopBackStringSocket instead of a regular StringSocket, but there is no handy method for that right now....


instance methods
  accessing
  clients

  attributes
  extent:depth:
numClients
sharedWorld

  initialization
  destroy
initialize
initializeForWorld:

  networking
  acceptNewConnections
acceptNullConnection
acceptPhonyConnection
addClientFromConnection:
backlog
processIO
pruneDeadConnections
startListeningOnPort:
step
stopListening

class methods
  as yet unclassified
  defaultPort
extremelyBigRectangle

  instance creation
  new
newForWorld:
serveWorld:
serveWorld:onPort:

instance methods
  accessing top  
 

clients


  attributes top  
 

extent:depth:

modify the extent and/or depth of the shared world


 

numClients

return the number of connected clients


 

sharedWorld


  initialization top  
 

destroy


 

initialize


 

initializeForWorld:


  networking top  
 

acceptNewConnections


 

acceptNullConnection


 

acceptPhonyConnection


 

addClientFromConnection:


 

backlog


 

processIO


 

pruneDeadConnections


 

startListeningOnPort:


 

step

Default for moephic models is no-op


 

stopListening


class methods
  as yet unclassified top  
 

defaultPort


 

extremelyBigRectangle


  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

newForWorld:


 

serveWorld:


 

serveWorld:onPort: