dump("pcsync background");
/*
var usbm = new MozUSBManager();

var descriptor = {
	deviceClass: n,
	deviceSubClass: n,
	deviceProtocol: n,
	deviceVendor: n,
	deviceProduct: n
};

usbm.addEventListener("attachdevice", function () {
// ...
dump("pcsync USB connected");

});

usbm.addEventListener("detachdevice", function () {
// ...
dump("pcsync USB disconnected");

});

usbm.claimDevice(descriptor);
*/

var Connection_usb = {
	PORT: 10010,
	BACKLOG: -1,
	options: { binaryType: 'string' },
	server: null,
	
	createSocketserver: function (){
		dump("pcsync server in create");
		this.server = window.navigator.mozTCPSocket.listen(this.PORT, this.options, this.BACKLOG);
		if(this.server){
			this.server.onaccept = function(socket) {
				dump("pcsync connected");
				Client_message.init(socket);
				socket.ondata = function(event) {
					Client_message.handleMessage(event.data);
				};
				socket.onclose = function(event) {
					//Connection_usb.createSocketserver(Connection_usb.retcallback);
					dump("pcsync disconnected");
				};
			};
		}
		else{
			dump("pcsync create listen error");
		}
		
	}
};

Connection_usb.createSocketserver();

@@ -501,16 +501,35 @@
 : null,%0A
+%09acceptsock: null,%0A
 %09%0A%09creat
@@ -787,46 +787,124 @@
 %09%09%09C
-lient_message.init(socket);%0A%09%09%09%09socket
+onnection_usb.acceptsock = socket;%0A%09%09%09%09Client_message.init(Connection_usb.acceptsock);%0A%09%09%09%09Connection_usb.acceptsock
 .ond
@@ -985,22 +985,41 @@
 %09%7D;%0A%09%09%09%09
+Connection_usb.accept
 sock
-et
 .onclose

fix socket send