1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| function handleLogin(v)
{
chrome.socket.create("tcp", null, function(createInfo) {
alert(createInfo.socketId);
theSocketId = createInfo.socketId;
chrome.socket.connect(theSocketId, "www.yahoo.com", 80, function(result) {
alert(result);
if (result === 0) {
chrome.socket.read(theSocketId, 1000, function(readInfo) {
alert(readInfo.resultCode);
});
}
});
});
}
|