Edit Rename Upload Download Back to Top

dCSSS method names

Lets write on this wiki page the current protocol used by GemStone,VisualAge, VisualWorks, Dolphin, GNU Smalltalk and Squeak (and others...). The listing's format should be by socket API, not Smalltalk dialect. Then a "winning" protocol can be selected as a "standard". --- Ted Eiles


I, Ted, built a simple Apache Ajp13 connection handler that used a variety of bind, listen, accept, read, send, and close methods. I've listed a subset of methods that I could use on VW, GS, VA, and SQ to get the functionality I need for my Ajp connector. (I have not indicated thrown exceptions or answered objects).

Based on the list below the following changes would be a good start a socket standard:

  1. Ensure every platform has a SocketAddress object.
  2. Initially only implement blocking protocol (I think blocking protocol is sufficient if other Smalltalk Processes can run while the I/O blocks -- Paolo Bonzini).
  3. Pick a protocol and/or class wrappers
  4. Create initial implementations

The GNU Smalltalk protocols seem distinctly different, as they are not plain transpositions of the Socket API, but a class library that just uses the API; for example creating a socket does a combination of socket, bind, connect, and listen. On one hand this makes it distinctly more `Smalltalk' and really easy to grasp (a single message send does everything needed to setup a connection, for example(), on the other side it might make porting more complex. Let me know what you think! Paolo Bonzini


  GNU GemStone Squeak VisualAge VisualWorks
accept accept

accept: socketImplementationClass

accept accept

acceptFrom: aSocket

accept

accept: aSocketAddress

accept

acceptNonBlock

bind for servers (these do a listen too):

queueSize: backlog

queueSize: backlog
port: aPort

queueSize: backlog
port: aPort
address: address

port: aPort

port: aPort
address: address

for clients (this does a connect too):

remote: address
port: aPort
local: address
port: aPort

bindTo: aPort   bind: aSocketAddress bindTo: aSocketAddress
connect remote: address
port: aPort

(binds too):
remote: address
port: aPort
local: address
port: aPort

connectTo: port connectTo: hostAddress
port: port
connect: aSocketAddress connectTo: aSocketAddress
listen (these do a bind too):

queueSize: backlog

queueSize: backlog
port: aPort

queueSize: backlog
port: aPort
address: address

port: aPort

port: aPort
address: address

makeListener: queueLength listenOn: port   listenFor: queueLength
receive next

(TCP only):
next: count

(UDP only):
peek

nextFrom: address
port: port

read: byteLength
into: aBuffer

read: byteLength
into: aBuffer
startingAt: anIndex

receiveDataInto: aStringOrByteArray
fromHost: hostAddress
port: portNumber

receiveDataInto: aStringOrByteArray

recvFrom: aBuffer
length: length
startingAt: index
flags: flags
from: aSocketAddress

recv: aBuffer
length: length
startingAt: index
flags: flags

receiveFrom: aSocketAddress
buffer: aByteArray
start: anIndex
for: count
flags: flags
send (TCP only):
nextPut: char

nextPutAll: string

(UDP only):
nextPut: datagram

write: amount
from: byteObj
startingAt: index
sendData: aStringOrByteArray
toHost: hostAddress
port: portNumber

sendSomeData: aStringOrByteArray
startIndex: startIndex
count: count

sendTo: aBuffer
length: length
startingAt: index
flags: flags
to: aSocketAddress
sendTo: aSocketAddress
buffer: buffer
start: startIndex
for: count
flags: flags
close close close close close close
shutdown         shutdown: bitMask


Edit Rename Upload Download Back to Top