Elasticsearch 9300 端口无法链接

第一次配置Elasticsearch 9300 端口 无法连接 这个坑 我填不进去了 帮忙看一下 谢谢了

图片说明图片说明图片说明图片说明

在注册9300 端口的时候 就会失败

图片说明

这是报的错误信息 版本 跟着走得 boot 降到了2.0 按道理来说 不应该 抱着错误的

求各位大佬 帮帮看 这是怎么回事

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{M2S7szsiSceYFvYzEC_HLg}{192.168.200.158}{192.168.200.158:9300}]
]

1个回答

配置成9200试试看?9300是elasticsearch集群内的通信端口,9200才是外部连接的端口。

weixin_44765605
绝望者x 回复zhaoxin_1993: 我每一次修改完配置文件就重新启动失败了,然后每次都要重新下载vim,慢的要死,都不知道是什么问题
3 个月之前 回复
weixin_44765605
绝望者x 回复zhaoxin_1993: 你好,我也是出现了这样的问题,但是我发现我的elasticsearch.yml文件有很多份,我不知道该改哪个。刚刚评论不知道为什么被删除了。
3 个月之前 回复
zhaoxin_1993
zhaoxin_1993 回复蜡笔没了小新git: docker 里面 修改 内部的配置文件 外部访问
3 个月之前 回复
ljcgit
蜡笔没了小新git 回复simonLJXiong: 请问你问题解决了吗
4 个月之前 回复
zhaoxin_1993
zhaoxin_1993 回复simonLJXiong: 是Docker 中的 es 配置文件需要修改。好像是跨域处理的问题,当初没找到 前段时间才看到个视频说了
8 个月之前 回复
qq_19357423
simonLJXiong 回复zhaoxin_1993: 请问解决了吗,我也遇到了这个问题!!!
8 个月之前 回复
chogzyo
chogzyo 回复zhaoxin_1993: 配置文件elasticsearch.yaml里有没有设置transport.tcp.port:9300。建议找下es的安装,确认一下es是否正确安装吧
一年多之前 回复
zhaoxin_1993
zhaoxin_1993 回复chogzyo: 就是搭建一个练习 使用 在创建9300 端口的时候就会出现图五 的 异常 就是连接无法使用 使用地址加上 9200 可以正常的在页面上查看数据 之前springdataES 版本是3.1 对应ES 6.2 docker 没有 降版本springdataES 2.1ES 2.4 依然促
一年多之前 回复
chogzyo
chogzyo 回复zhaoxin_1993: 查看端口的时候有9300吗?es的集群能够互相连接吗?
一年多之前 回复
zhaoxin_1993
zhaoxin_1993 9200 能够正常使用,但是我需要用java链接Elasticsearch 进行数据操作 只能使用9300 的端口吧? 映射路径了 但是 在创建路径的时候 就已经无法找到了,困扰我两天了
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ElasticSearch端口9200向所有人开放。 这是错的吗?

<div class="post-text" itemprop="text"> <p>我用一个PHP-Symfony应用程序和一个mysql数据库运行Elasticsearch。 一切都顺利,但我只有一个担心,不确定这是不是关键。希望社区能提供帮助。</p> <p>If I'm trying to access my server IP on port 9200 like this:</p> <blockquote> <p><a href="http://%5BserverIP%5D:9200" rel="nofollow noreferrer">http://[serverIP]:9200</a></p> </blockquote> <p>我有一个JSON /Object输出:</p> <pre><code>{ "status" : 200, "name" : "Cutthroat", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.3", "build_hash" : "NA", "build_timestamp" : "NA", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" } </code></pre> <p>因此,我的问题是:每个人都可以访问此URL吗? 这是安全漏洞吗? 请尽可能提供资源说明您的观点,谢谢。</p> <p>如果是的话, 那该如何解决 <code>port 9200</code>这个问题? 并且只对<code>localhost</code> 和 <code>iptables</code>授权,但是Elasticsearch随后停止了工作。</p> </div>

elasticsearch容器无法访问

搭建springcloud的基础运行环境,elasticsearch容器访问不到,端口已经进行过影射了。 elasticsearch6.2版本在 虚拟机Ubuntu16.04 上的 Docker容器 docker内环境为CentOS7 虚拟机内存8G,el给了2G,ip也对,求救help!!!!! 下面出测试: ``` Ubuntu内测试 curl 192.168.9.131:9200 curl: (7) Failed to connect to 192.168.9.131 port 9200: 拒绝连接 虚拟机防火墙状态: root@SpringEnv:/home/mfz# systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: inactive (dead) since 一 2019-11-11 21:27:25 CST; 57min ago Process: 866 ExecStart=/usr/sbin/firewalld --nofork --nopid (code=exited, status=0/SUCCESS) Main PID: 866 (code=exited, status=0/SUCCESS) ``` 在宿主机测试 ``` C:\Users\54185>telnet 192.168.9.131:9200 正在连接192.168.9.131:9200...无法打开到主机的连接。 在端口 23: 连接失败 ``` 容器在运行 ![图片说明](https://img-ask.csdn.net/upload/201911/11/1573482500_464628.png) 以下为配置文件: jvm.options ``` ## JVM configuration ################################################################ ## IMPORTANT: JVM heap size ################################################################ ## ## You should always set the min and max JVM heap ## size to the same value. For example, to set ## the heap to 4 GB, set: ## ## -Xms4g ## -Xmx4g ## ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html ## for more information ## ################################################################ # Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space -Xms2g -Xmx2g ################################################################ ## Expert settings ################################################################ ## ## All settings below this section are considered ## expert settings. Don't tamper with them unless ## you understand what you are doing ## ################################################################ ## GC configuration -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly ## optimizations # pre-touch memory pages used by the JVM during initialization -XX:+AlwaysPreTouch ## basic # explicitly set the stack size -Xss1m # set to headless, just in case -Djava.awt.headless=true # ensure UTF-8 encoding by default (e.g. filenames) -Dfile.encoding=UTF-8 # use our provided JNA always versus the system one -Djna.nosys=true # turn off a JDK optimization that throws away stack traces for common # exceptions because stack traces are important for debugging -XX:-OmitStackTraceInFastThrow # flags to configure Netty -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 # log4j 2 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=${ES_TMPDIR} ## heap dumps # generate a heap dump when an allocation from the Java heap fails # heap dumps are created in the working directory of the JVM -XX:+HeapDumpOnOutOfMemoryError # specify an alternative path for heap dumps # ensure the directory exists and has sufficient space #-XX:HeapDumpPath=/heap/dump/path ## JDK 8 GC logging 8:-XX:+PrintGCDetails 8:-XX:+PrintGCDateStamps 8:-XX:+PrintTenuringDistribution 8:-XX:+PrintGCApplicationStoppedTime 8:-Xloggc:logs/gc.log 8:-XX:+UseGCLogFileRotation 8:-XX:NumberOfGCLogFiles=32 8:-XX:GCLogFileSize=64m # JDK 9+ GC logging 9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m # due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise # time/date parsing will break in an incompatible way for some date patterns and locals 9-:-Djava.locale.providers=COMPAT ``` elasticsearch.yml ``` # ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # Before you set out to tweak and tune the configuration, make sure you # understand what are you trying to accomplish and the consequences. # # The primary way of configuring a node is via this file. This template lists # the most important settings you may want to configure for a production cluster. # # Please consult the documentation for further information on configuration options: # https://www.elastic.co/guide/en/elasticsearch/reference/index.html # # ---------------------------------- Cluster ----------------------------------- # # Use a descriptive name for your cluster: # cluster.name: elasticsearch-application # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # #node.name: node-1 # # Add custom attributes to the node: # #node.attr.rack: r1 # # ----------------------------------- Paths ------------------------------------ # # Path to directory where to store the data (separate multiple locations by comma): # "elasticsearch.yml" 94L, 2864C # Path to log files: # #path.logs: /path/to/logs # # ----------------------------------- Memory ----------------------------------- # # Lock the memory on startup: # #bootstrap.memory_lock: true # # Make sure that the heap size is set to about half the memory available # on the system and that the owner of the process is allowed to use this # limit. # # Elasticsearch performs poorly when the system is swapping the memory. # # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # # http.port: 9200 network.host: 0.0.0.0 # # Set a custom port for HTTP: # # # For more information, consult the network module documentation. # # --------------------------------- Discovery ---------------------------------- # # Pass an initial list of hosts to perform discovery when new node is started: # The default list of hosts is ["127.0.0.1", "[::1]"] # #discovery.zen.ping.unicast.hosts: ["host1", "host2"] # # Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1): # #discovery.zen.minimum_master_nodes: # # For more information, consult the zen discovery module documentation. # # ---------------------------------- Gateway ----------------------------------- # # Block initial recovery after a full cluster restart until N nodes are started: # #gateway.recover_after_nodes: 3 # # For more information, consult the gateway module documentation. # # ---------------------------------- Various ----------------------------------- # # Require explicit names when deleting indices: # #action.destructive_requires_name: true ```

windows系统下(win10) 使用IP:9200地址无法访问win10虚拟机里的ElasticSearch

windows系统下(win10) 使用IP:9200地址无法访问win10虚拟机里的ElasticSearch,网上全是linux的,有大神知道windows系统下这个东西该怎么搞吗?按照网上什么VIM,改NetWork.host的,好像都是linux系统的做法,windows没人用过吗?

Docker-无法从外部访问docker端口

<div class="post-text" itemprop="text"> <p>So i created a new EC2 Instance and installed docker on it.</p> <p>I deployed code from ( <a href="https://github.com/commonsearch/cosr-front/blob/master/INSTALL.md" rel="nofollow">https://github.com/commonsearch/cosr-front/blob/master/INSTALL.md</a> ) and followed install instructions.</p> <p>Install was successfull and i started the server:</p> <pre><code>[ec2-user@ip-172-30-0-127 cosr-front]$ make docker_devserver docker run -e DOCKER_HOST --rm -v "/home/ec2-user/cosr-front:/go/src/github.com/commonsearch/cosr-front:rw" -w /go/src/github.com/commonsearch/cosr-front -p 9700:9700 -i -t commonsearch/local-front make devserver mkdir -p build go build -o build/cosr-front.bin ./server GODEBUG=gctrace=1 COSR_DEBUG=1 ./build/cosr-front.bin 2016/05/28 16:32:38 Using Docker host IP: 172.17.0.1 2016/05/28 16:32:38 Server listening on 127.0.0.1:9700 - You should open http://127.0.0.1:9700 in your browser! </code></pre> <p>Well, now when i want to access it from outside, i cant! Not even curl the local server.</p> <p>When i run <code>docker ps</code> it gives me correct port forwarding: </p> <pre><code>[ec2-user@ip-172-30-0-127 ~]$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1a9f77e1eeb1 commonsearch/local-front "make devserver" 4 minutes ago Up 4 minutes 0.0.0.0:9700-&gt;9700/tcp stoic_hopper 9ff00fe3e70d commonsearch/local-elasticsearch-devindex "/docker-entrypoint.s" 4 minutes ago Up 4 minutes 0.0.0.0:39200-&gt;9200/tcp, 0.0.0.0:39300-&gt;9300/tcp kickass_wilson </code></pre> <p>These are my docker images:</p> <pre><code>REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE &lt;none&gt; &lt;none&gt; 3e205118cd3f 17 minutes ago 853.3 MB &lt;none&gt; &lt;none&gt; 1d233da1fa59 2 hours ago 955.7 MB debian jessie ce58426c830c 4 days ago 125.1 MB commonsearch/local-front latest 30de7ab48d43 7 weeks ago 1.024 GB commonsearch/local-elasticsearch-devindex latest b1156ada5a24 11 weeks ago 383.2 MB commonsearch/local-elasticsearch latest 808e72f49b4a 3 months ago 355.2 MB </code></pre> <p>I have tryed disabling ipv6 and all kind of nonsense google offered me, but without success.</p> <p>Any ideas ?</p> <p>EDIT:</p> <p>Also, if i enter the docker container for frontend( using docker exec ), then I CAN PING AND CULR the frontend.</p> <p>But i cant from the outside( nor ssh, not from my home pc using browser ).</p> <p>Also my docker version:</p> <pre><code>Client: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5/1.9.1 Built: OS/Arch: linux/amd64 Server: Version: 1.9.1 API version: 1.21 Go version: go1.4.2 Git commit: a34a1d5/1.9.1 Built: OS/Arch: linux/amd64 </code></pre> </div>

centos6.7防火墙开通了端口,但其它机器无法访问

我在机器上布置了nginx,开放的端口是81,我开放防火墙的81端口,无法访问,但在我关闭了防火墙之后就可以访问了。 防火墙规则如下: ![图片说明](https://img-ask.csdn.net/upload/201703/23/1490250901_751428.png)

elasticsearch6.12 安装了x-pack之后TLS该如何配置?

我该如何通过x-pack的certutil 生成证书及密钥,这理该生成什么类型的证书呢? 证书生成之后该如何配置每个elasticsearch节点的配置文件以及kibana的kibana.yml呢? 我用的全是6.12版本。

无法连接到我的代理elasticsearch节点

<div class="post-text" itemprop="text"> <p>I'm having issues with connecting from my Go client to my es node.</p> <p>I have elasticsearch behind an nginx proxy that sets basic auth. All settings are default in ES besides memory.</p> <p>Via browser it works wonderfully, but not via this client: <a href="https://github.com/olivere/elastic" rel="nofollow noreferrer">https://github.com/olivere/elastic</a></p> <p>I read the docs and it says it uses the /_nodes/http api to connect. Now this is probably where I did something wrong because the response from that api looks like this:</p> <pre><code>{ "_nodes" : { "total" : 1, "successful" : 1, "failed" : 0 }, "cluster_name" : "elasticsearch", "nodes" : { "u6TqFjAvRBa3_4FndfKh4w" : { "name" : "u6TqFjA", "transport_address" : "127.0.0.1:9300", "host" : "127.0.0.1", "ip" : "127.0.0.1", "version" : "5.6.2", "build_hash" : "57e20f3", "roles" : [ "master", "data", "ingest" ], "http" : { "bound_address" : [ "[::1]:9200", "127.0.0.1:9200" ], "publish_address" : "127.0.0.1:9200", "max_content_length_in_bytes" : 104857600 } } } } </code></pre> <p>I'm guessing I have to set the IPs to my actual IP/domain (my domain is like es01.somedomain.com)</p> <p>So how do i correctly configure elastisearch so that my go client can connect?</p> <p>My config files for nginx look similar to this: <a href="https://www.elastic.co/blog/playing-http-tricks-nginx" rel="nofollow noreferrer">https://www.elastic.co/blog/playing-http-tricks-nginx</a></p> <p><strong>Edit: I found a temporary solution by setting elastic.SetSniff(false) in the Options for the client, but I think that means I can't scale ES horizontally. So still looking for an alternative.</strong></p> </div>

进行flume监控端口案例是,总是出现telent connection refused

1.问题场景 Centos7 做flume案例时,telnet hadoop-senior03 44444 总是Connection redused, Trying 192.168.10.22... telnet: connect to address 192.168.10.22: Connection refused 不知道原因 检查了防火墙也是关闭状态 xinetd.d的文件如下 [admin@hadoop-senior01 xinetd.d]$ ll total 44 -rw------- 1 root root 1157 Nov 5 2016 chargen-dgram -rw------- 1 root root 1159 Nov 5 2016 chargen-stream -rw------- 1 root root 1157 Nov 5 2016 daytime-dgram -rw------- 1 root root 1159 Nov 5 2016 daytime-stream -rw------- 1 root root 1157 Nov 5 2016 discard-dgram -rw------- 1 root root 1159 Nov 5 2016 discard-stream -rw------- 1 root root 1148 Nov 5 2016 echo-dgram -rw------- 1 root root 1150 Nov 5 2016 echo-stream -rw------- 1 root root 1212 Nov 5 2016 tcpmux-server -rw------- 1 root root 1149 Nov 5 2016 time-dgram -rw------- 1 root root 1150 Nov 5 2016 time-stream在 xinetd.d文件夹中也没有如上的文件,没有https://blog.csdn.net/qq_22203741/article/details/77663932?utm_source=blogxgwz0 和http://blog.sina.com.cn/s/blog_9c581bd30102vub1.html中的又可以改参数的文件

vcenter在私网中,esxi在公网中。求vcenter管理公网esxi方法(直接连无用,因为esxi无法向vcenter汇报,开放了几个端口也没用)

vcenter在私网中,esxi在公网中。求vcenter管理公网esxi方法(直接连无用,因为esxi无法向vcenter汇报,开放了几个端口也没用)

presto查询es报错:NoNodeAvailableException

![图片说明](https://img-ask.csdn.net/upload/202002/17/1581944246_377375.png) use catalog 或者 show schemas 什么都是正常的. 但是 select 查询具体表的时候就会报这个错..求教是什么原因. 配置文件也试着改了好几次,以后可能会使用java 配置如下(其余配置如官网,如有怀疑请提问),拜谢各位: ![图片说明](https://img-ask.csdn.net/upload/202002/17/1581950758_684158.png)![图片说明](https://img-ask.csdn.net/upload/202002/17/1581950767_293136.png)

sonar安装 修改web接口问题

我使用CRT软件进行远程连接,到一台linux,然后配置安装sonar,已经成功,但是在浏览器上输入 http://localhost:9000/,不能打开访问,别人说是接口问题,怎样修改接口??

通过本地运行的Go代码连接到远程Aerospike服务器的问题

<div class="post-text" itemprop="text"> <p>I have installed Go (1.8.0) on my Mac (10.10 and then upgraded to 10.12), and then followed the steps at <a href="https://github.com/aerospike/aerospike-client-go" rel="nofollow noreferrer">https://github.com/aerospike/aerospike-client-go</a> for getting the Aerospike client library on my machine.</p> <p>We have code that we have created and works with our remote server IP address(es) for Aerospike on coworkers' machines as well as a VM running on Google Cloud. This code does not work on my machine. I have even tried the test code that is in the aerospike-client-go README, and I get the same error: <code>Failed to connect to host(s): [X.X.X.X:3000]; error: Connecting to the cluster timed out.</code></p> <p>I am able to ping those IP addresses on port 3000 without any issues.</p> <p>Is there a configuration that I might be missing that might have to be changed (environmental variable, etc) to get this to go?</p> </div>

C#SOCKET长连接小数据程序未响应

最近由于业务的需要,Linux系统嵌入式设备往我做的服务程序发送数据。 速度奇慢,而且还是程序无响应。后来自己用C#写了一个客户端用来测试。已经用了线程池,不知道用法对不对。请大家帮忙看下。 服务端: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Net.Sockets; using System.Net; namespace consoleSocketServer { class Program { static int socketCount = 0; static Socket serverSocket; static Socket clientSocket; public static int clientcount = 0; public int clientnum = 0; static int listSQL = 0; static bool asy = true; public static Int32 portServer = 0; public static string ipServer = ""; public static Thread threadSocketListen; public static Thread threadDoWork; public static Thread threadInsert; public static int countsql = 0; static void Main(string[] args) { IPAddress ipAddress; portServer = 4660; serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); ipAddress = IPAddress.Parse("192.168.33.29"); ipServer = ipAddress.ToString(); IPEndPoint localEndPoint = new IPEndPoint(ipAddress, portServer); Console.WriteLine("服务器IP:" + ipServer + " 端口:" + portServer); serverSocket.Bind(localEndPoint); serverSocket.Listen(20); //设置线程池 ThreadPool.SetMaxThreads(4, 4); //开启新的线程监听 threadSocketListen = new Thread(SocketListen); threadSocketListen.Start(); Console.WriteLine("服务启动成功"); } static void SocketListen() { while (true) { //接受客户端信息 clientSocket = serverSocket.Accept(); //开启处理线程 ThreadPool.QueueUserWorkItem(new WaitCallback(doWork)); //threadDoWork = new Thread(new ThreadStart(doWork)); //threadDoWork.Start(); } } /// <summary> /// 处理方法 /// </summary> static void doWork(object a) { //获取客户端信息 IPEndPoint ipEndPoint = (IPEndPoint)clientSocket.RemoteEndPoint; string address = ipEndPoint.Address.ToString(); //Console.WriteLine(address + ":连接成功"); //取消息 byte[] inBuffer = new byte[1024]; byte[] outBuffer = new byte[8]; string inBufferStr = ""; int rec = 0; StringBuilder sb = new StringBuilder(); while (true) { try { rec = clientSocket.Receive(inBuffer);//如果没有消息为空 阻塞 当前循环 //收到的长度不够 忽略此次数据 if (rec <= 8) { continue; } int ll = inBuffer[4] + inBuffer[5] * 255; inBufferStr = Encoding.UTF8.GetString(inBuffer, 8, ll); Console.WriteLine(inBufferStr); //回复收到 outBuffer[4] = 0; outBuffer[5] = 0; outBuffer[6] = 0; outBuffer[7] = 0; outBuffer[3] = 0; outBuffer[2] = 0; outBuffer[1] = 0; outBuffer[0] = 1; clientSocket.Send(outBuffer, outBuffer.Length, SocketFlags.None); socketCount++; Console.WriteLine(socketCount.ToString()); //break; } catch (SocketException es) { //clientSocket.Close(); return; } } } } } 客户端: using System; using System.Collections.Generic; using System.Text; using System.Net.Sockets; using System.Net; using System.Threading; namespace SocketClient { class Program { static Socket clientSocket; static void Main(string[] args) { try { //将网络端点表示为IP地址和端口 用于socket侦听时绑定 IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("192.168.33.29"), 4660); clientSocket = new Socket(ipep.AddressFamily, SocketType.Stream, ProtocolType.Tcp); //将Socket连接到服务器 clientSocket.Connect(ipep); string outBufferStr; //发送消息 outBufferStr = "123456789qwe|789654123|1|2015-04-22 10:51:34|6|test1|test2| "; byte[] tempb = Encoding.UTF8.GetBytes(outBufferStr); byte[] outBuffer = new byte[tempb.Length + 8]; //加功能和长度 outBuffer[0] = 1; outBuffer[1] = 0; outBuffer[2] = 0; outBuffer[3] = 0; outBuffer[4] = Convert.ToByte(tempb.Length % 255); outBuffer[5] = Convert.ToByte(tempb.Length / 255); outBuffer[6] = 0; outBuffer[7] = 0; for (int i = 0; i < tempb.Length; i++) { outBuffer[8 + i] = tempb[i]; } // Byte[] inBuffer = new Byte[1024]; int kkk = 0; while (kkk <= 10000) { clientSocket.Send(outBuffer, outBuffer.Length, SocketFlags.None); kkk++; Thread.Sleep(1); Console.WriteLine(kkk.ToString()); //Console.WriteLine("服务器响应:"); //接收服务器端信息 //clientSocket.Receive(inBuffer, 1024, SocketFlags.None); //Console.WriteLine(Encoding.ASCII.GetString(inBuffer)); } Console.WriteLine(kkk.ToString()); Console.ReadLine(); } catch (Exception exp) { Console.WriteLine(exp.Message); Console.ReadLine(); } } } } 客户端收到数据,显示出来,在回发一个byte[] 1 0 0 0 0 0 0 0 用于确认收到。 实际上目前客户端没有对服务端收到的数据做处理,因为那样又要多开一个线程。 但是现在问题就是这样简单的测试发送10000条数据,居然会卡死,很纳闷。我前几天见他们Linux自己写的程序发送1W条数据,就是2 3秒的时间。请大神指导。难道C#真的是不能做服务端的程序?

串口通信返回数据出错问题

我想从调试助手里发送一个多位数到单片机上,然后单片机处理加1返回到电脑,结果我发1,返回1;发123,返回24;发12,返回2,这是什么问题啊,我发一段代码,大家能帮我看一下吗 ``` #include<reg52.h> #include"bstv51.h" unsigned char num=0; void Uart_Init(); void main() { Uart_Init(); while(1); } void Uart_Init() { TMOD=0X20;//设置定时器1工作方式为2,8位重装定时器 TH1=0XFD; TL1=0XFD; //设置波特率为9600 SCON=0X50;//设置串口工作方式为1,8位元uart,开启接受允许 PCON=0X00;//波特率不加倍 EA=1; ES=1; TR1=1; } void Uart_Isr() interrupt 4 { if(TI) { TI=0; REN=1; } if(RI) { RI=0; num=SBUF; num++; SBUF=num; REN=0; } } ```

java错误:Connection refused:connect

这是我主界面,我想在这点开文件,然后可以发送给连接的人,目前的测试就是自己给自己发。 package com.fastSendFile; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; import java.net.InetAddress; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Vector; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTable; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.table.DefaultTableColumnModel; import javax.swing.table.DefaultTableModel; import javax.swing.table.JTableHeader; public class SendWindow { // private static final SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd:HH:mm:ss"); // private static Object lock1 = new Object(); private Object[] columnNames = { "用户名", "工作组","主机名","优先级", "IP地址", "port","" }; private String myName = ""; private UDP udpService; private static SendWindow sendWindow; int add =0; int count=0,flag=0; JFrame frame; File f; File file; JButton reFresh; JButton send; JButton file_btn; JButton open_file; JLabel userOnline; JLabel userCount; JCheckBox packaging; JCheckBox lock; JTable table; JTextArea inputArea; JScrollPane scrollPaneTable; JScrollPane scrollPaneFile; JSplitPane jSplitPane; JPanel panelSouth; JPanel panelSouthNorth; JPanel panelSouthSouth; JPanel panelNorth; JPanel panelNorthEast; private JFileChooser filechooser; private AddFileWindow addFileWindow; String filename = "",filePath = "",filepath=""; long fileSize = 0; int d = 0,port; public Vector fileVector = new Vector(); private void createWindow() { //分割容器 jSplitPane=new JSplitPane();//创建一个分割容器类 jSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);//设置分割线方向 jSplitPane.setDividerSize(5); jSplitPane.setDividerLocation(50);//设置分割线位于中央 //上半部分整体布局 panelNorth = new JPanel(new BorderLayout()); panelNorthEast = new JPanel(new BorderLayout()); panelNorth.add(panelNorthEast,BorderLayout.EAST); jSplitPane.setTopComponent(panelNorth); //下半部分整体布局 panelSouth = new JPanel(new BorderLayout()); panelSouthNorth = new JPanel(); panelSouthSouth = new JPanel(); inputArea = new JTextArea(); scrollPaneFile = new JScrollPane(inputArea); scrollPaneFile.setPreferredSize(new Dimension(500, 150)); scrollPaneFile.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); file_btn = new JButton(); // panelSouthNorth.add(fileName); file_btn.setVisible(false); FlowLayout flowLayout2 = new FlowLayout(FlowLayout.CENTER , 10 , 10); panelSouthSouth.setLayout(flowLayout2); panelSouth.add(file_btn,BorderLayout.NORTH); panelSouth.add(scrollPaneFile,BorderLayout.CENTER); panelSouth.add(panelSouthSouth,BorderLayout.SOUTH); jSplitPane.setBottomComponent(panelSouth); DefaultTableModel tableModel = new DefaultTableModel(null, columnNames); table = new JTable(tableModel){ private static final long serialVersionUID = 1L; @Override public boolean isCellEditable(int row, int column) { return false; } }; scrollPaneTable = new JScrollPane(); scrollPaneTable.setPreferredSize(new Dimension(500, 150)); //scrollPaneTable.setPreferredSize(panelNorth.getPreferredSize()); scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); //scrollPane.setBounds(new Rectangle(76, 35, 257, 193)); //table.setFillsViewportHeight(true); //panelNorth.add(table.getTableHeader(), BorderLayout.PAGE_START); panelNorth.add(scrollPaneTable,BorderLayout.WEST); // JScrollPane tableScroll = new JScrollPane(); JTableHeader header = table.getTableHeader(); header.setBounds(0, 0, 400, 20); table.setBounds(0, 20, 400, 180); DefaultTableColumnModel columnModel = (DefaultTableColumnModel) table.getColumnModel(); columnModel.removeColumn(columnModel.getColumn(6)); scrollPaneTable.setViewportView(header); scrollPaneTable.setViewportView(table); scrollPaneTable.setBounds(0, 0, 400, 200); scrollPaneTable.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //scrollPaneTable = new JScrollPane(table); //scrollPaneTable.setPreferredSize(new Dimension(500, 150)); //scrollPaneTable.setPreferredSize(panelNorth.getPreferredSize()); //scrollPaneTable.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); //scrollPane.setBounds(new Rectangle(76, 35, 257, 193)); //table.setFillsViewportHeight(true); //panelNorth.add(table.getTableHeader(), BorderLayout.PAGE_START); panelNorth.add(scrollPaneTable,BorderLayout.WEST); //上半部分标签和按钮 userOnline = new JLabel("在线用户",JLabel.CENTER); userCount = new JLabel("0",JLabel.CENTER); reFresh = new JButton("刷新(R)"); panelNorthEast.add(userOnline,BorderLayout.NORTH); panelNorthEast.add(userCount,BorderLayout.CENTER); panelNorthEast.add(reFresh,BorderLayout.SOUTH); //下半部分拖拽 DropTargetAdapter kgd=new DropTargetAdapter() { @Override public void drop(DropTargetDropEvent dtde) { try { Transferable tf=dtde.getTransferable(); if(tf.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List lt=(List)tf.getTransferData(DataFlavor.javaFileListFlavor); Iterator itor=lt.iterator(); while(itor.hasNext()) { f=(File)itor.next(); filename = f.getName(); fileSize = f.length(); filePath = f.getPath(); file_btn.setText(f.getName()); // fileName.setText(f.getPath()); //fileName.setText(f.getPath().substring(filePath.lastIndexOf("\\") + 1)); file_btn.setVisible(true); fileVector.add(f); add = 0; // flag+=1; //frame.removeAll(); // frame.repaint(); if(fileSize>0) { open_file.setEnabled(false); } } dtde.dropComplete(true); } else { dtde.rejectDrop(); } } catch(Exception e) { e.printStackTrace(); } } }; new DropTarget(inputArea,DnDConstants.ACTION_COPY_OR_MOVE,kgd); file_btn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addFileWindow = AddFileWindow.createWindow(getInstance()); addFileWindow.frame.setVisible(true); System.out.println("file_btn:"+f.getName()+f.length()+f.getPath()); addFileWindow.showFile(f.getName(),f.length(),f.getPath()); } }); //下半部分按钮和复选按钮 open_file = new JButton("添加文件"); send = new JButton("发送(S)"); packaging = new JCheckBox("封装(E)"); packaging.setSelected(true); lock = new JCheckBox("上锁(K)"); panelSouthSouth.add(open_file); panelSouthSouth.add(send); panelSouthSouth.add(packaging); panelSouthSouth.add(lock); open_file.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { filechooser = new JFileChooser(); filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int option = filechooser.showDialog(null, "选择文件"); if (option == 0) { file = filechooser.getSelectedFile(); filePath = file.getPath(); file_btn.setText(file.getName()); file_btn.setVisible(true); add = 0; } } }); packaging.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(packaging.isSelected()==false) { lock.setSelected(false); lock.setEnabled(false); } } }); //整个布局 frame = new JFrame("FastSend"); frame.setSize(595, 420); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.setResizable(true); frame.setContentPane(jSplitPane); jSplitPane.setDividerLocation(0.5); //frame.pack(); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent event) { try { udpService.broadcast("offline#"); } catch (IOException e) { e.printStackTrace(); } } }); reFresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.repaint(); } }); send.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String msg = inputArea.getText(); if(add==1) { filepath = ""; } else { filepath = filePath; } System.out.println("1111filepath:"+filepath); if ((msg != null && msg.length() > 0) || (filepath != null && filepath.length() > 0)) { List<Map<String, String>> selected = getSelected(); if (selected == null) { JOptionPane.showMessageDialog(null, "请选择发送对象!", "注意", JOptionPane.INFORMATION_MESSAGE); return; } for (Map<String, String> map : selected) { String addr = map.get("addr"); int port = Integer.parseInt(map.get("port")); try { StringBuffer sb = new StringBuffer("msg#"); sb.append(myName); msg = (msg != null && msg.length() > 0) ? msg : "null"; sb.append("#" + msg.replaceAll("#", "*")); filepath = (filepath != null && filepath.length() > 0) ? filepath : "null"; sb.append("#" + filepath); //if(addFileWindow.) udpService.send(addr, port, sb.toString()); Vector sendList = new Vector( ); sendList.add(fileVector); int[] selectRows = table.getSelectedRows(); InetAddress sendAddress; DefaultTableModel model = (DefaultTableModel) table.getModel(); // for (int i = 0; i < selectRows.length; i++) { // String addr = model.getValueAt(selectRows[i], 3).toString(); sendAddress=InetAddress.getByName( ( String ) model.getValueAt (selectRows[0] ,3 ) ); Thread clientThread=new Thread(new Client( sendList ,sendAddress)); clientThread.setPriority(6); clientThread.start(); // } } catch (IOException e1) { e1.printStackTrace(); } } inputArea.setText(null); file_btn.setVisible(false); file_btn.setText(""); sendWindow.setVisible(false); //filepath = ""; filename = ""; fileSize = 0; filePath = ""; d= 1; System.out.println("哈哈"+filepath); } else { System.out.println("wode.."); JOptionPane.showMessageDialog(null, "请输入内容或选择文件!", "注意", JOptionPane.INFORMATION_MESSAGE); } } }); } private void addRow(String userName,String hostGroup,String hostName,String Priority,String hostAddr, int hostPort) { DefaultTableModel model = (DefaultTableModel) table.getModel(); model.addRow(new Object[] { userName,hostGroup,hostName, Priority,hostAddr, hostPort }); } private void rmRow(String addr) { DefaultTableModel model = (DefaultTableModel) table.getModel(); for (int i = 0, j = table.getRowCount(); i < j; i++) { String taddr = model.getValueAt(i, 2).toString(); if (taddr.equals(addr)) { model.removeRow(i); break; } } } private List<Map<String, String>> getSelected() { int[] selectRows = table.getSelectedRows(); if (selectRows.length == 0) { return null; } List<Map<String, String>> selected = new ArrayList<Map<String, String>>(); DefaultTableModel model = (DefaultTableModel) table.getModel(); for (int i = 0; i < selectRows.length; i++) { String addr = model.getValueAt(selectRows[i], 3).toString(); port = Integer.parseInt(model.getValueAt(selectRows[i], 5).toString()); Map<String, String> map = new HashMap<String, String>(); map.put("addr", addr); map.put("port", port + ""); selected.add(map); } return selected; } public void setInpuArea(String str) { this.inputArea.setText(str); } public void setVisible(boolean b) { frame.setVisible(b); } private SendWindow() throws IOException { this.createWindow(); myName = System.getProperty("user.name"); udpService = new UDP(); ReceiveThread thread = new ReceiveThread(); thread.start(); udpService.broadcast("online#" + myName); count++; userCount.setText(count+""); frame.repaint(); // TCP.init(); } public static SendWindow getInstance() { // synchronized (lock1) { if (sendWindow == null) { try { sendWindow = new SendWindow(); } catch (IOException e) { e.printStackTrace(); } } return sendWindow; // } } class ReceiveThread extends Thread { @Override public void run() { try { while (true) { Map<String, String> recMap = udpService.receive(); if (recMap != null && recMap.size() > 0) { handlData(recMap); } } } catch (IOException e) { e.printStackTrace(); } } void handlData(Map<String, String> recMap) throws IOException { String data = recMap.get("data").trim(); String hostName = recMap.get("hostName"); String hostGroup = ""; String hostAddr = recMap.get("hostAddr"); String Priority = ""; int hostPort = Integer.parseInt(recMap.get("hostPort")); String[] dataArr = data.split("#"); if (dataArr[0].equals("online")) {// 收到上线消息后回复发消息给我的人 String userName = dataArr[1]; addRow(userName,hostGroup,hostName, Priority,hostAddr, hostPort); udpService.send(hostAddr, hostPort, "reply#" + dataArr[1]); return; } if (dataArr[0].equals("reply")) {// 更新在线table if(!hostAddr.equals(InetAddress.getLocalHost().getHostAddress())){ String userName = dataArr[1]; addRow(userName,hostGroup,hostName, Priority,hostAddr, hostPort); count++; userCount.setText(count+""); frame.repaint(); } return; } if (dataArr[0].equals("offline")) {// 下线消息,更新table rmRow(hostAddr); count--; userCount.setText(count+""); frame.repaint(); return; } if (dataArr[0].equals("msg")) {// 接收文本消息 ReceiveWindow receiveWindow = ReceiveWindow.createWindow(getInstance()); String msg = dataArr[2].equals("null") ? "":dataArr[2]; String file = dataArr[3].equals("null") ? "":dataArr[3]; System.out.println("hhfilename"+file); receiveWindow.showMsg(dataArr[1] + "/" + hostName, msg, file, hostAddr); //addFileWindow.showFile( filename,fileSize,filePath); return; } } } public static void main(String[] args) throws IOException { SendWindow sendWindow = SendWindow.getInstance(); } } 这是接收客户端,是端口选择的问题吗,我要怎么改呢T T package com.fastSendFile; import java.awt.GridLayout; import java.util.*; import java.net.*; import java.io.*; import javax.swing.*; public class Client implements Runnable { private Vector Vname=new Vector(); private InetAddress address; private Vector sendDir = new Vector(); private Vector fileVector = new Vector(); private long totalSize; private long fileSize; private String fileName; private long receivedSize; private long skipSize; SendWindow sendWindow; Client( Vector file , InetAddress address) { fileVector.addAll ( file ) ; this.address = address; } public void getFiles(File file,String lastDir ,String localPath) { if(file.isFile()) { totalSize += file.length(); sendDir.add (localPath); Vname.add(new String(lastDir + "/"+file.getName())); } else if(file.isDirectory()) { lastDir = lastDir + "/" + file.getName(); String strs[] = file.list(); for(int i = 0 ;i < strs.length; i ++) { File newfile = new File( file.getAbsolutePath() + "/" + strs[i] ); getFiles( newfile , lastDir , localPath ); } } } public void run() { totalSize = 0; String send = ""; try { byte[] buffer = new byte[1024]; Socket sendSocket = new Socket(address, 20); DataInputStream in = new DataInputStream(sendSocket.getInputStream()); BufferedOutputStream outb = new BufferedOutputStream(sendSocket.getOutputStream(),512); DataOutputStream out = new DataOutputStream(outb); ObjectOutputStream oout = new ObjectOutputStream (out); oout.writeObject ( fileVector ); oout.flush (); ObjectInputStream oin = new ObjectInputStream ( in ); Vector accVector = (Vector) oin.readObject (); if ( sendWindow.d ==1) JOptionPane.showMessageDialog(null, "消息已发送","提示",JOptionPane.DEFAULT_OPTION); for (int i = 0 ; i < accVector .size (); i ++) { File temp = (File) accVector.get ( i ); send += " " + temp.getName (); getFiles( temp ,"",temp.getParent ()); } //receive file out.writeLong(totalSize); out.flush(); int rSize; File tempFile; String tempString; long count ; JFrame frame = new JFrame(); frame.setTitle("正在发送文件"); JLabel lable1 = new JLabel(); JLabel lable2 = new JLabel(); JLabel lable3 = new JLabel(); frame.add( lable1,"North" ); frame.add( lable3,"South" ); receivedSize = 0; JProgressBar bar = new JProgressBar ( 0 , (int)(totalSize/1024)); JProgressBar bar1 = new JProgressBar (); bar.setForeground(new java.awt.Color(102, 255, 102)); bar.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)), "\u603b\u8fdb\u5ea6", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(0, 0, 255))); bar.setDoubleBuffered(true); bar.setStringPainted ( true ) ; bar1.setSize (320,20); bar.setSize (320,20); bar1.setForeground(new java.awt.Color(102, 255, 102)); bar1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)), "当前进度", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 13), new java.awt.Color(0, 0, 255))); bar1.setDoubleBuffered(true); bar1.setStringPainted ( true ); JPanel jp = new JPanel(); jp.setLayout ( new GridLayout( 3 , 1 )); // jp.add ( new JLabel ("总进度: ")); jp.add ( bar ); // jp.add ( new JLabel( "当前进度: " )); jp.add ( bar1 ); jp.add ( lable2 ); frame.add ( jp ); String Lmessage1 = "总共要发送: "+String.valueOf( totalSize / 1024) + " KB"; String Lmessage2 = "速度: 0"; lable1.setText( Lmessage1 ); lable2.setText( Lmessage2 ); lable3.setText ( "共" + Vname.size () + "个文件,已完成" + 0 + "个"); RandomAccessFile inFile; frame.setBounds( 250 , 200 , 400 , 200); frame.setResizable ( false ); frame.setVisible(true); long baseTime = new Date().getTime(); for(int i = 0;i < Vname.size();i++) { count = 0; lable3.setText ( "共" + Vname.size () + "个文件,已完成" + i + "个"); bar1.setMinimum ( 0 ); tempString = ( String ) Vname.get(i); tempFile = new File( sendDir.get(i) + tempString); fileSize = tempFile.length(); jp.setToolTipText ( "正发送:" + tempString.substring ( 1 ) ); out.writeLong(fileSize); int locate = new Random().nextInt ( 1000 ); byte [] fileRandom = new byte [10]; if ( tempFile.length () < 1024 ) locate = -1 ; else fileRandom = getFile( locate,tempFile ); out.writeInt ( locate ); out.write ( fileRandom ); frame.setTitle ( "正发送文件:" + tempString.substring ( 1 ) ); bar1.setMaximum ( ( int )fileSize / 1024 ); bar1.setValue ( 0 ); byte data2[] = tempString.getBytes( "UTF-8" ); out.write(data2); out.flush(); skipSize = in.readLong(); rSize = in.read(buffer); String reBack = new String(buffer,0,rSize,"UTF-8"); if("S".equals(reBack)) { receivedSize += fileSize; count = fileSize; bar.setValue ( (int) receivedSize / 1024); bar1.setValue ((int) count / 1024); continue; } else { if("C".equals(reBack)) { receivedSize += skipSize; count = skipSize; bar.setValue ( ( int )receivedSize / 1024 ); bar1.setValue ( ( int )count /1024 ); inFile = new RandomAccessFile(tempFile, "r"); inFile.seek( skipSize ); } else { inFile=new RandomAccessFile(tempFile, "r"); } while((rSize = inFile.read(buffer)) != -1) { receivedSize += rSize; count += rSize; bar.setValue ( ( int )receivedSize / 1024 ); bar1.setValue ( ( int )count / 1024 ); lable2.setText("速度: "+ String.valueOf(receivedSize * 1000 / (new Date().getTime() - baseTime + 1) / 1024 )+" KB/s"); outb.write( buffer, 0 ,rSize ); } outb.flush(); inFile.close(); } } fileSize = -1; out.writeLong(fileSize); out.writeInt ( -1 ); out.write( new byte [10]); byte data3[] = "#发送完毕#".getBytes("UTF-8"); out.write(data3); out.flush(); frame.setVisible(false); JOptionPane.showMessageDialog(null, "发送完成!","提示", JOptionPane.DEFAULT_OPTION); in.close(); out.close(); sendSocket.close(); } catch(Exception e) { JOptionPane.showMessageDialog(null, "发送文件出错l:"+e,"错误", JOptionPane.ERROR_MESSAGE); } } public static byte [] getFile( int n , File file) { byte [] b = new byte [10]; try { RandomAccessFile rf = new RandomAccessFile(file,"r"); rf.seek ( n ); rf.read ( b, 0 ,b.length); rf.close (); } catch (Exception e) { } return b; } }

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Linux 会成为主流桌面操作系统吗?

整理 |屠敏出品 | CSDN(ID:CSDNnews)2020 年 1 月 14 日,微软正式停止了 Windows 7 系统的扩展支持,这意味着服役十年的 Windows 7,属于...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

学习总结之HTML5剑指前端(建议收藏,图文并茂)

前言学习《HTML5与CSS3权威指南》这本书很不错,学完之后我颇有感触,觉得web的世界开明了许多。这本书是需要有一定基础的web前端开发工程师。这本书主要学习HTML5和css3,看...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

冒泡排序动画(基于python pygame实现)

本项目效果初始截图如下 动画见本人b站投稿:https://www.bilibili.com/video/av95491382 本项目对应github地址:https://github.com/BigShuang python版本:3.6,pygame版本:1.9.3。(python版本一致应该就没什么问题) 样例gif如下 ======================= 大爽歌作,mad

Redis核心原理与应用实践

Redis核心原理与应用实践 在很多场景下都会使用Redis,但是到了深层次的时候就了解的不是那么深刻,以至于在面试的时候经常会遇到卡壳的现象,学习知识要做到系统和深入,不要把Redis想象的过于复杂,和Mysql一样,是个读取数据的软件。 有一个理解是Redis是key value缓存服务器,更多的优点在于对value的操作更加丰富。 安装 yum install redis #yum安装 b...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

立即提问
相关内容推荐