Skip to content

Instantly share code, notes, and snippets.

@adam-singer
Created March 24, 2012 22:07
Show Gist options
  • Save adam-singer/2188456 to your computer and use it in GitHub Desktop.
Save adam-singer/2188456 to your computer and use it in GitHub Desktop.
Socket broken in dart bleeding_edge?
#import('dart:io');
main() {
Socket s = new Socket("127.0.0.1", 8888);
print('s = ${s.available()}');
}
/*
From the folllowing build socketTest.dart had no problems running.
http://gsdview.appspot.com/dart-editor-archive-continuous/5549/dart-editor-macosx.cocoa.x86_64.zip
$> /tmp/dart/dart-sdk/bin/dart socketTest.dart
s = 0
On dart-sdk from Version 0.1.0.201203232000, Build 5803, Dart SDK version 5803, Dartium version the following error happens
$> ~/Documents/DartEditor/dart/dart-sdk/bin/dart socketTest.dart
Unhandled exception:
SocketIOException: Error: available failed - invalid socket handle
0. Function: '_Socket@14117cc4.available' url: 'dart:io' line:6753 col:5
1. Function: '::main' url: 'file:///Users/adam/dart/mongo-dart/examples/socketTest.dart' line:5 col:26
Same with building from source
$> svn info
Path: .
URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Repository Root: http://dart.googlecode.com/svn
Repository UUID: 260f80e4-7a28-3924-810f-c04153c831b5
Revision: 5804
Node Kind: directory
Schedule: normal
Last Changed Author: ahe@google.com
Last Changed Rev: 5804
Last Changed Date: 2012-03-24 01:51:37 -0700 (Sat, 24 Mar 2012)
$> ~/dart_bleeding/dart/out/Debug_ia32/dart socketTest.dart
Unhandled exception:
SocketIOException: Error: available failed - invalid socket handle
0. Function: '_Socket@14117cc4.available' url: 'dart:io' line:6753 col:5
1. Function: '::main' url: 'file:///Users/adam/dart/mongo-dart/examples/socketTest.dart' line:5 col:26
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment