Skip to content

Instantly share code, notes, and snippets.

View BerkCalik's full-sized avatar

Berk Çalık BerkCalik

View GitHub Profile
@BerkCalik
BerkCalik / mfs-client.min.js
Created March 19, 2020 09:01
mfs-client.min.js
function BigInteger(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function nbi(){return new BigInteger(null)}function am1(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i}function am2(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],h=this[t++]>>15,c=a*u+h*s;i=((u=s*u+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+a*h+(i>>>30),r[n++]=1073741823&u}return i}function am3(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],h=this[t++]>>14,c=a*u+h*s;i=((u=s*u+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+a*h,r[n++]=268435455&u}return i}function int2char(t){return BI_RM.charAt(t)}function intAt(t,e){var r=BI_RC[t.charCodeAt(e)];return null==r?-1:r}function bnpCopyTo(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function bnpFromInt(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function nbv(t){var e=n
private void btnSend_Click(object sender, EventArgs e)
{
foreach (var item in clients)
{
item.Send("_SERVER_MESSAGE_:"+txtMessage.Text);
}
log("_SERVER_MESSAGE_:" + txtMessage.Text);
txtMessage.Text = "";
}
void updateListBox()
{
Invoke((MethodInvoker)delegate {
lbClients.Items.Clear();
foreach (var item in clients)
{
lbClients.Items.Add(item.ConnectionInfo.Id);
}
});
}
void log(string msg)
{
if (InvokeRequired)
{
Invoke((MethodInvoker)delegate { rtxtLog.Text += msg + "\r\n"; });
return;
}
else
{
rtxtLog.Text += msg + "\r\n";
private void btnStart_Click(object sender, EventArgs e)
{
var server = new WebSocketServer("ws://"+txtServerAddress.Text+":"+txtServerPort.Text);
server.Start(socket =>
{
socket.OnOpen = () => {
log("Bağlantı sağlandı. : "+socket.ConnectionInfo.Id);
clients.Add(socket);
updateListBox();
};
WebSocketServer server;
List<Fleck.IWebSocketConnection> clients = new List<IWebSocketConnection>();