dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Shortest Flash Socket Server... 46 characters

  1. #1
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Shortest Flash Socket Server... 146 characters (update - 91 characters now)

    Try this Ruby on for size!!

    Code:
    require "socket";$m=TCPServer.open("10.0.0.2", 4444);while true; Thread.start($m.accept) do |s|;while s.gets("\0");s.write($_);end;s.close;end;end
    Yeah... I LOVE RUBY!!!


  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhm...

    I guess I could have left a ton of things out even then.. if all you wanted was to connect with one SWF, and not multiple...

    Code:
    require "socket";s=TCPServer.open("10.0.0.2",4444).accept;loop{;s.gets("\0");s.write($_);};
    So... it will only accept one connection - and it exits when the client leaves...

    91 characters!!!

    ... I know I've found the perfect language!


  3. #3
    Flash Developer on a break
    Join Date
    Jun 2001
    Location
    The Netherlands
    Posts
    1,370
    Oo Ruby?

    What kind of scripting language is that? And what program did you use to make it?

    ..just curious..

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center