Andreas Raab uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ar.75.mcz
==================== Summary ====================
Name: Network-ar.75
Author: ar
Time: 24 July 2010, 3:08:56.964 pm
UUID: 41c4e3ec-04fd-4949-b38e-7fa37e9a4874
Ancestors: Network-ar.74
Some SocketStream simplifications: Avoid duplication between #receiveData; #receiveDataIfAvailable; and #receiveAvailableData; they are just minor variants of each other. Also bottleneck all socket reads and writes in two SocketStream methods #receiveDataInto:startingAt: and #sendData:count: so that subclasses can do additional operations on them (encryption, statistics etc).
=============== Diff against Network-ar.74 ===============
Item was added:
+ ----- Method: SocketStream>>receiveDataInto:startingAt: (in category 'private-socket') -----
+ receiveDataInto: buffer startingAt: index.
+ "Read data from the underlying socket. This method may be overridden by subclasses wanting to control incoming traffic for other purposes like encryption or statistics."
+
+ ^socket receiveAvailableDataInto: buffer startingAt: index.!
Item was added:
+ ----- Method: SocketStream>>sendData:count: (in category 'private-socket') -----
+ sendData: buffer count: n
+ "Sends outgoing data directly on the underlying socket."
+
+ ^socket sendData: buffer count: n!
Item was changed:
----- Method: SocketStream>>receiveDataIfAvailable (in category 'private-socket') -----
receiveDataIfAvailable
+ "Deprecated. Use #receiveAvailableData instead"
- "Only used to check that there really is data to read
- from the socket after it signals dataAvailable.
- It has been known to signal true and then still
- not have anything to read. See also isDataAvailable.
- Return the position in the buffer where the
- new data starts, regardless if anything
- was read, see #adjustInBuffer."
+ ^self receiveAvailableData!
- recentlyRead := socket receiveSomeDataInto: inBuffer startingAt: inNextToWrite.
- ^self adjustInBuffer: recentlyRead!
Item was changed:
----- Method: SocketStream>>receiveData (in category 'private-socket') -----
receiveData
+ "Receive data. Signal exceptions and timeouts depending on #shouldSignal and #shouldTimeout. Return the position in the buffer where the new data starts, regardless if anything was read."
+
+ socket
+ waitForDataFor: self timeout
+ ifClosed: [self shouldSignal
+ ifTrue:[ConnectionClosed signal: 'Connection closed while waiting for data.']]
+ ifTimedOut: [self shouldTimeout
+ ifTrue:[ConnectionTimedOut signal: 'Data receive timed out.']].
+ ^self receiveAvailableData!
- "Receive data with timeout if it has been set.
- If shouldSignal is false we use the Socket methods
- that swallow those Exceptions, if it is true the
- caller will have to handle those Exceptions.
- Return the position in the buffer where the
- new data starts, regardless if anything
- was read, see #adjustInBuffer."
-
- recentlyRead := shouldSignal ifTrue: [
- self shouldTimeout ifTrue: [
- socket receiveDataSignallingTimeout: timeout
- into: inBuffer startingAt: inNextToWrite]
- ifFalse: [
- socket receiveDataSignallingClosedInto: inBuffer
- startingAt: inNextToWrite]]
- ifFalse: [
- self shouldTimeout ifTrue: [
- "This case is tricky, if it times out and is swallowed
- how does other methods calling this method repeatedly
- get to know that? And what should they do?"
- socket receiveDataTimeout: timeout
- into: inBuffer startingAt: inNextToWrite]
- ifFalse: [
- socket receiveDataInto: inBuffer
- startingAt: inNextToWrite]].
- ^self adjustInBuffer: recentlyRead!
Item was changed:
----- Method: SocketStream>>nextPutAllFlush: (in category 'stream out') -----
nextPutAllFlush: aCollection
"Put a String or a ByteArray onto the stream.
You can use this if you have very large data - it avoids
copying into the buffer (and avoids buffer growing)
and also flushes any other pending data first."
| toPut |
toPut := binary ifTrue: [aCollection asByteArray] ifFalse: [aCollection asString].
self flush. "first flush pending stuff, then directly send"
socket isOtherEndClosed ifFalse: [
+ [self sendData: toPut count: toPut size]
- [socket sendData: toPut count: toPut size]
on: ConnectionTimedOut
do: [:ex | shouldSignal ifFalse: ["swallow"]]]!
Item was changed:
----- Method: SocketStream>>flush (in category 'control') -----
flush
"If the other end is connected and we have something
to send, then we send it and reset the outBuffer."
((outNextToWrite > 1) and: [socket isOtherEndClosed not])
ifTrue: [
+ [self sendData: outBuffer count: outNextToWrite - 1]
- [socket sendData: outBuffer count: outNextToWrite - 1]
on: ConnectionTimedOut
do: [:ex | shouldSignal ifFalse: ["swallow"]].
outNextToWrite := 1]!
Item was changed:
----- Method: SocketStream>>isDataAvailable (in category 'testing') -----
isDataAvailable
+ "Answer if more data can be read. It the inbuffer is empty, we check the socket for data. If it claims to have data available to read, we try to read some once and recursively call this method again. If something really was available it is now in the inBuffer. This is because there has been spurious dataAvailable when there really is no data to get.
+
+ Note: Some subclasses (such as SecureSocketStream) rely on the behavior here since even though data may be available in the underlying socket, it may not result in any output (yet)."
- "It the inbuffer is empty, we check the socket for data.
- If it claims to have data available to read, we try to read
- some once and recursively call this method again.
- If something really was available it is now in the inBuffer.
- This is because there has been spurious
- dataAvailable when there really is no data to get."
self isInBufferEmpty ifFalse: [^true].
^socket dataAvailable
ifFalse: [false]
+ ifTrue: [self receiveAvailableData; isDataAvailable]!
- ifTrue: [self receiveDataIfAvailable; isDataAvailable]!
Item was changed:
----- Method: SocketStream>>receiveAvailableData (in category 'private-socket') -----
receiveAvailableData
+ "Receive available data (as much as fits in the inBuffer) but not waiting for more to arrive. Return the position in the buffer where the new data starts, regardless if anything was read, see #adjustInBuffer."
- "Receive available data (as much as fits in the inBuffer)
- but not waiting for more to arrive.
- Return the position in the buffer where the
- new data starts, regardless if anything
- was read, see #adjustInBuffer."
+ recentlyRead := self receiveDataInto: inBuffer startingAt: inNextToWrite.
- recentlyRead := socket receiveAvailableDataInto: inBuffer startingAt: inNextToWrite.
^self adjustInBuffer: recentlyRead!
** PLEASE EXCUSE US IF YOU RECEIVE MULTIPLE COPIES **
CALL FOR PAPERS
SMALLTALKS 2010
4th Argentinian Smalltalk Conference
Research Track: Call for Papers
November 11th – 13th, 2010
Important dates:
Submission (Hard Deadline): September 7th, 2010 (Argentinian time:
UTC/GMT -3 hours).
Notification of acceptance: October 6th, 2010.
Camera Ready Submission: October 20th, 2010.
---------------------------------------------------------------------------------
Conference Site: Universidad Tecnológica Nacional (UTN), Concepción del
Uruguay (Entre Ríos, Argentina)
In the past three years the Smalltalks series of conferences
(www.fast.org.ar) have been a lively forum on Smalltalk-based software
technologies that attracted over more than 200 people from both academia
and industry for three days.
During the first three conferences, the industrial partners showed the
applicability of Smalltalk in business, while researches (both students
and professors) showed their advances and didactic uses of Smalltalk.
The presented approaches and methodologies concerned the language, its
implementation technology, its programming tools as well as the
software development culture it supports.
This year the accepted papers not only will be available in the website
but also the best ranked ones will be published in a special edition of
Elsevier COMLAN Journal. Thus, we invite to submit papers in the
research track on original scientific research conducted in and/or for
Smalltalk in general.
Topics of interest include, but are not restricted to:
• Aspects, Aspect Languages and Applications.
• Ambient Intelligence, Ubiquitous / Pervasive Computing and
Embedded Systems.
• Compilation Technology, Optimization, Virtual Machines.
• Educational Material.
• Language Engineering, Extensions.
• Model Driven Engineering / Development.
• Meta-Modeling, Reflection and Meta-programming.
• Programming in the Large, Design, Architectures and Components.
• Programming Environments, Browsers, User Interfaces, UI Frameworks.
• Reasoning About Code (Analysis, Refactoring, Type Inference,
Metrics).
• Team Management.
• Testing, Extreme Programming / Practices.
• Web Services, Internet Applications, Event-driven Programming.
• Experience Reports.
Important dates:
Submission (Hard Deadline): September 7th, 2010 (Argentinian time:
UTC/GMT -3 hours).
Notification of acceptance: October 6th, 2010.
Camera Ready Submission: October 20th, 2010.
Papers:
Papers should be written in English, in pdf-format and not exceed 15
pages (including references and figures), using Elsevier journal format.
Templates for LaTeX formats can be found at
http://www.elsevier.com/wps/find/authorsview.authors/elsart
Papers must be submitted through the EasyChair submission web site at
http://www.easychair.org/conferences/?conf=smalltalks10
The accepted papers will be digitally available in the conference
website. From accepted papers, selected ones will be published in a
special edition of Elsevier COMLAN Journal.
Papers submitted must not have been previously published and must not be
under review for publication elsewhere. Papers must strictly adhere to
submission guidelines. If you have questions, please send an e-mail to
Marcus Denker and Gabriela Arévalo to smalltalks2010-chair(a)fast.org.ar
using [Smalltalks2010-RT] as a tag in the e-mail subject.
Program Committee
--------------------------
• Alexandre Bergel (DCC, Universidad de Chile, Chile)
• Noury Bouraqadi (Ecole des Mines, Douai, France)
• Gilad Bracha (Ministry of Truth, USA)
• Johan Brichau (Inceptive.be, Belgium)
• Johan Fabry (DCC, Universidad de Chile, Chile)
• Alejandro Fernandez (LIFIA - Facultad de Informática – UNLP,
Argentina)
• Tudor Girba (Sw-eng. Software Engineering GmbH, Switzerland)
• Andy Kellens (SOFT, Vrije Universiteit Brussels, Belgium)
• Michele Lanza (University of Lugano, Switzerland)
• Adrian Lienhard (SCG, University of Bern, Switzerland)
• Damien Pollet (INRIA / Université de Lille 1, France)
• Lukas Renggli (SCG, University of Bern, Switzerland)
• David Röthlisberger (SCG, University of Bern, Switzerland)
• Tom Van Cutsem (SOFT, Vrije Universeit Brussels, Belgium)
Program Chairs
--------------------
• Marcus Denker (INRIA, Lille, France)
• Gabriela Arévalo (Universidad Austral, Buenos Aires, Argentina)
.
Hi all,
I've tried twice in the last 3 days to reset the password for my account on
SqueakSource. Each time the link that comes in email just lands me at the
home page.
Is this broken, or am I missing the trick somehow?
Thanks,
Jim