Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Async TcpClient Socket doesn't receive Data

Hello, there are no errors but if i send some data to the client it wont the client don't receive it...

can anyon help(Ninja please don't help me or leave a comment)

Code
https://msdn.microsoft.com/en-us/library....110).aspx

Just cast the AsyncState to a TcpClient object and go from there.
(Sep 5, 2016 04:03 PM)Ninja Wrote:  https://msdn.microsoft.com/en-us/library....110).aspx

Just cast the AsyncState to a TcpClient object and go from there.

Damn it Ninja, he said for you not to help him 🤦‍♂ (Click to View)
(Sep 6, 2016 02:14 AM)Josh‎ Wrote:  Damn it Ninja, he said for you not to help him 🤦‍♂ (Click to View)

Im bothered by retardation. People cant code and post sources of shitty code, I point it out.
GitHub wouldn't load for me for some reason. But judging by the "ProxyScraper" git project in the URL, I'd assume you're trying to open web traffic to test a proxy with a TCPClient? If that's what you're trying to do then a TCPClient is over-engineering your solution.

Try this (**NOTE: This was done in notepad from memory, please ignore the ugly capitalization/inconsistent casing):
Code
    public sub Main()
        Dim Proxies as new List(Of WebProxy)
        
        'Load list of proxies here using Proxies.Add(new WebProxy("HOST:PORT", True))
        
        For Each Proxy as WebProxy in Proxies.ToArray()
            if ProxyWorks(Proxy) then
                'Working Proxy!
            else
                'Non-working Proxy!
            end if
        next
    End Sub
    
    public function ProxyWorks(Proxy as WebProxy) as Boolean
        dim ProxyTestClient as new WebClient()
        ProxyTestClient.Proxy = Proxy
        try
            if ProxyTestClient.DownloadString("URL") <> Nothing then
                return true
            end if
        catch Ex as Exception
            'Up to you if you'd like to do more complex error-handling here, e.g.: determine WHY the proxy failed, etc.
            return false
        end try
    end function

And if you want to get really fancy/clean with it, figure out how to do it all asynchronously! 🤝
(Sep 6, 2016 11:06 AM)Dianab0lical. Wrote:  GitHub wouldn't load for me for some reason. But judging by the "ProxyScraper" git project in the URL, I'd assume you're trying to open web traffic to test a proxy with a TCPClient? If that's what you're trying to do then a TCPClient is over-engineering your solution.

Try this (**NOTE: This was done in notepad from memory, please ignore the ugly capitalization/inconsistent casing):
Code
    public sub Main()
        Dim Proxies as new List(Of WebProxy)
        
        'Load list of proxies here using Proxies.Add(new WebProxy("HOST:PORT", True))
        
        For Each Proxy as WebProxy in Proxies.ToArray()
            if ProxyWorks(Proxy) then
                'Working Proxy!
            else
                'Non-working Proxy!
            end if
        next
    End Sub
    
    public function ProxyWorks(Proxy as WebProxy) as Boolean
        dim ProxyTestClient as new WebClient()
        ProxyTestClient.Proxy = Proxy
        try
            if ProxyTestClient.DownloadString("URL") <> Nothing then
                return true
            end if
        catch Ex as Exception
            'Up to you if you'd like to do more complex error-handling here, e.g.: determine WHY the proxy failed, etc.
            return false
        end try
    end function

And if you want to get really fancy/clean with it, figure out how to do it all asynchronously! 🤝
This has to be the worst way to test proxies ever.
(Sep 6, 2016 12:04 PM)Ninja Wrote:  This has to be the worst way to test proxies ever.

Appreciate your feedback.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ahmet1257Mar 10, 2022 09:51 AM 2 228 Mar 10, 2022 09:51 AM
Last Post: benio2
[C#] by LookdadonMar 7, 2022 01:38 PM 7 264 Mar 7, 2022 01:38 PM
Last Post: Lookdadon
[.NET] by elmagekOct 24, 2021 02:50 PM 7 293 Oct 24, 2021 02:50 PM
Last Post: #Kat