Exemplo n.º 1
0
    void ThreadConnect(object obj)
    {
        FTPConnectData fcd = (FTPConnectData)obj;

        try
        {
            fcd.socket.Connect(fcd.ippoint);
            fcd.connected = fcd.socket.Connected;
        }
        catch
        {
        }
    }
Exemplo n.º 2
0
    FTPConnectData CreateConnectData(ServerIPData sid)
    {
        FTPConnectData fcd = new FTPConnectData();
        Socket         s   = TCPClient.CreateSocket(true, true);

        s.ReceiveBufferSize = 65536 * 2;
        s.ReceiveTimeout    = 10000000;
        fcd.connected       = false;
        fcd.socket          = s;
        fcd.ippoint         = new IPEndPoint(IPAddress.Parse(sid.IP), sid.Port);
        Thread th = new Thread(new ParameterizedThreadStart(ThreadConnect));

        th.Start(fcd);
        return(fcd);
    }