草庐IT

FileEvent

全部标签

go - 无法让接口(interface)片段工作

我想做的是创建一个interface类型的slice,并用一些实现此接口(interface)的结构类型填充它。chans:=[]chanEvent{make(chanFileEvent),make(chanNetworkEvent),}但这失败了cannotusemake(chanFileEvent)(typechanFileEvent)astypechanEventinarrayorsliceliteral。现在我知道这是meanttobethatway.然而,建议的解决方案是a)不切实际,因为我有一堆不同的类型,无法轻易地迭代它们,并且b)我什至无法让它工作,它仍然给我同样的错误

java - 为什么我的 TCP 连接在运行命令后关闭? - java

我有一个简单的FTP服务器和客户端。现在,客户端可以发送文件,服务器可以接受它,但是在我运行sendFile()命令后,它传输文件,服务器和客户端终止,之后无法运行任何其他命令.服务器importjava.io.File;importjava.io.FileOutputStream;importjava.io.IOException;importjava.io.ObjectInputStream;importjava.net.ServerSocket;importjava.net.Socket;importmmd.filetransfer.FileEvent;publicclassSe