| Edit | Rename | Upload | Download | Back to Top |
Based on the list below the following changes would be a good start a socket standard:
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 queueSize: backlog port: aPort port: aPort for clients (this does a connect too): remote: address | bindTo: aPort | bind: aSocketAddress | bindTo: aSocketAddress | |
| connect | remote: address port: aPort (binds too): | connectTo: port | connectTo: hostAddress port: port | connect: aSocketAddress | connectTo: aSocketAddress |
| listen | (these do a bind too): queueSize: backlog queueSize: backlog queueSize: backlog port: aPort port: aPort | makeListener: queueLength | listenOn: port | listenFor: queueLength | |
| receive | next (TCP only): (UDP only): nextFrom: address | read: byteLength into: aBuffer read: byteLength | receiveDataInto: aStringOrByteArray fromHost: hostAddress port: portNumber receiveDataInto: aStringOrByteArray | recvFrom: aBuffer length: length startingAt: index flags: flags from: aSocketAddress recv: aBuffer | 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 | 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 |