Pop-Up Thingie
Sidebar
Home
Synchronet BBS Software
Forum
Downloads
Files
Dark
Register
Log in
Username
Password
Sidebar
Forum
DOVE-Net
Synchronet JavaScript
Final Proxy Code
From
Drakmir
@HDONE to
Digital Man
on Friday, October 07, 2005 01:34:00
0
0
load("sbbsdefs.js"); // CON_RAW_IN
load("sockdefs.js"); // SO_RCVBUF
function sendData(socketA, socketB)
{
var bRetVal = false;
var buf;
if(socketA.data_waiting)
{
var numRead = socketA.nread;
if (numRead >= 512) numRead = 512;
buf = socketA.peek(numRead);
if (numRead != buf.length)
{
while(numRead > 4)
{
buf = socketA.recvBin(4);
socketB.sendBin(buf, 4);
numRead -= 4;
}
if (numRead > 0)
{
buf = socketA.recvBin(numRead);
socketB.sendBin(buf, numRead);
}
}
else
{
buf = socketA.read(numRead);
socketB.write(buf);
}
bRetVal = true;
}
return bRetVal;
}
try
{
if (argc < 2)
{
throw("No parameters passed.");
};
var socket = new Socket();
if(!socket.bind()) {
throw("!bind error " + socket.last_error + "\r\n");
exit();
}
var addr=argv[0];
var port=argv[1];
if(!socket.connect(addr,port)) {
throw("!connect error " + socket.last_error + "\r\n");
exit();
}
log("\r\nConnected to " + addr + ":" + port + "\r\n");
while(socket.is_connected && client.socket.is_connected)
{
if (sendData(socket, client.socket)) continue;
if (sendData(client.socket, socket)) continue;
sleep(1);
}
log("\r\nEnd of socktest!\r\n");
}
catch(E)
{
log("Caught error - " + E);
exit(-1);
}
exit(0);
---
■ Synchronet ■ Holodeck One - bbs.holodeckone.com
Who's Online
Recent Visitors
Ted
Thursday, November 21, 2024 07:32:05
from
Va
via
SSH
Chris Jacobs
Thursday, November 21, 2024 05:01:30
from
Almere Netherlands
via
Telnet
Apam
Thursday, November 21, 2024 02:46:45
from
Toowoomba, Qld
via
Telnet
Chris Jacobs
Wednesday, November 20, 2024 18:44:02
from
Almere Netherlands
via
Telnet
System Info
Sysop:
digital man
Location:
Riverside County, California
Users:
1,043
Nodes:
15 (
0
/
15
)
Uptime:
42:02:50
Calls:
500,900
Calls today:
3
Files:
109,370
D/L today:
4,746 files
(492M bytes)
Messages:
304,224