Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mrFavoslav/KeyDrop-BOT
Browse files Browse the repository at this point in the history
  • Loading branch information
mrFavoslav committed Jan 27, 2025
2 parents 5caae6a + cecf327 commit c4289ff
Show file tree
Hide file tree
Showing 11 changed files with 1,213 additions and 236 deletions.
Binary file modified README.md
Binary file not shown.
44 changes: 44 additions & 0 deletions app/Guidzgo/Extencion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Guidzgo
{
public static class Extencion
{
public static void TryDispose(this IDisposable d)
{
try
{
d.Dispose();
}
catch { }
}

public static async Task ReadExactlyAsync(this Stream s, byte[] buf, int index, int lenght, CancellationToken token = default)
{
int r = 0;
while (r < lenght)
{
var r2 = await s.ReadAsync(buf, index + r, lenght - r, token);
if (r2 == 0)
throw new EndOfStreamException();
r += r2;
}
}

public static async Task AcceptTcpClientAsync(this TcpListener tcp, CancellationToken token)
{
void callback(IAsyncResult r)
{

}
var res = tcp.BeginAcceptTcpClient(callback, null);
}
}
}
Loading

0 comments on commit c4289ff

Please sign in to comment.