-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Is this problem - if not problem, then why this occurs? - solved/tracked ?

Thanks in advance.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF7qQmQqspS1+XJHgRAlJVAKDEuVEPHy0ZUCpp/ryp8QhmYaayfQCgwam4
+WzICM8DtNqgVhOofDoaEWc=
=1SUl
-----END PGP SIGNATURE-----
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Attached file is simple echo server and I did test with nc(netcat)
like this;

echo -e "hello\r\n" | nc localhost 8123

again, which returns "hllo" instead of correct "hello".

Thanks in advance.

Paolo Bonzini wrote:
> Can you please send the source code?
> 
> Thanks,
> 
> Paolo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFF63MrQqspS1+XJHgRAu0HAKCDosZPK6glYOSEDSnC8CMe9U/AWgCWOtLc
1SxbzA+tTyIg76Iw0F7Ytw==
=G+GN
-----END PGP SIGNATURE-----
"Filed out from GNU Smalltalk version 2.2b on 26-Oct-2006  10:30:02"!

Smalltalk.Object subclass: #SocketTest
        instanceVariableNames: 'buffer socket '
        classVariableNames: ''
        poolDictionaries: ''
        category: nil!

SocketTest comment: 
nil!

!SocketTest class methodsFor: 'instance creation'!

new
  | n |
  n := super new.
  n init.
  ^n
! !

!SocketTest methodsFor: 'basic'!

handle: sock
   | hunk | 
   [
      [
         [ sock atEnd ] whileFalse: [
             hunk := sock nextHunk.
             "Transcript show: sock readBuffer; cr.
             hunk := sock upTo: Character cr.
             Transcript show: hunk; cr."
             sock nextPutAll: hunk.
             sock flush.
             sock close.
         ].
      ] ensure: [ sock close ]
   ] fork
!

init
   buffer := String new
!

run
   'Starting server...' displayNl.
   socket := TCP.ServerSocket port: 8123.
   socket isNil ifTrue: [ self error: 'couldn''t create ServerSocket!' ].
   [
      socket waitForConnection.
      'Got connection!' displayNl.
      self handle: (socket accept)
   ] repeat
!

start
   self run.
   "[self run] fork." "OOPS!, this does not work on GST!!!"
!

stop
   socket close
! !

SocketTest new start!

--- End Message ---
_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to