是否有可能在Android手机上使用SQLite和C++?我没有找到任何关于如何实现这一目标的文件.
我目前正在开发一个python项目,需要通过Python套接字从客户端传输到服务器.这是我当前的代码,但是不传输整个文件,但根据文件大小,总会丢失一些或者额外的字节.
_con和con是通过python套接字的连接包装器连接.
客户:
def _sendFile(self, path):
sendfile = open(path, 'rb')
data = sendfile.read()
self._con.sendall(data)
self._con.send(bytes('FIN', 'utf8'))
# Get Acknowledgement
self._con.recv(6)
def _recieveFile(self, path):
# Recieve the file from the client
writefile = open(path, 'wb')
i = 0
while (1):
rec = self.con.recv(1024)
if (rec.endswith(b'FIN')):
break
writefile.write(rec)
self.con.send(b'ACK')
Run Code Online (Sandbox Code Playgroud)