server

How to send a file in Qt?

我只是一个虾纸丫 提交于 2020-12-04 05:10:58
问题 I'm trying to send a file from client to server. But it sends only a part of file. Seems like it happens when the size of file is more than 2Mb. What can be the problem? Sorry if it's a stupid question but I can't find an answer in Google. This is client cpp: #include "widget.h" Widget::Widget(QWidget *parent) : QWidget(parent) { progressBar = new QProgressBar(this); tcpSocket = new QTcpSocket(this); fileLabel = new QLabel(this); progressLabel = new QLabel(this); fileBtn = new QPushButton

linux tomcat 汤姆凯特

对着背影说爱祢 提交于 2020-11-09 17:32:37
IEDA 启动不了 tomcat . Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099 原因是我tomcat 环境没有配置好.没有指定JAVA_HOME和TOMCAT_HOME 在start.sh 中添加好JAVA_HOME 之后. JAVA_HOME=/usr/local/jdk1.8.0_25 PATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar TOMCAT_HOME=/home/MySoft/apache-tomcat-7.0.57 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program cannot find bin setclasspath sh this file is needed to run this program 在 bin

Java Socket实战之二 多线程通信

落花浮王杯 提交于 2020-11-05 14:21:52
本文地址:http://blog.csdn.net/kongxx/article/details/7259465 Java Socket实战之一 单线程通信 上一篇文章说到怎样写一个最简单的Java Socket通信,但是在上一篇文章中的例子有一个问题就是Server只能接受一个Client请求,当第一个Client连接后就占据了这个位置,后续Client不能再继续连接,所以需要做些改动,当Server没接受到一个Client连接请求之后,都把处理流程放到一个独立的线程里去运行,然后等待下一个Client连接请求,这样就不会阻塞Server端接收请求了。每个独立运行的程序在使用完Socket对象之后要将其关闭。具体代码如下: package com.googlecode.garbagecan.test.socket.sample2; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; public class MyServer { public static void main