c++本地服务器监听了端口,用netstat命令查缺找不到,http请求也收不到

大神们,帮看看,刚学c++,我用vs2017写了c++个简单的本地服务器,监听8000端口,我用c++的客户端就可以监听到端口请求,说明代码没问题。用http就收不到握手请求,用netstat命令查,没有找到8000端口,c++服务器监听的端口找不到,但是能收到c++客户端的请求。

2个回答

大神帮看看,纠结好几天了

第一 如果 netstat 没有找到8000端口的监听状态的话 只能说明你的这个服务根本没有启动起来

weixin_30707621
黑涩感觉 但是用c++的客户端访问8000端口,服务器能监听到
接近 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
c++本地服务器监听了端口,用netstat命令查缺找不到,http请求也收不到

大神们,帮看看,刚学c++,我用vs2017写了c++个简单的本地服务器,监听8000端口,我用c++的客户端就可以监听到端口请求,说明代码没问题。用http就收不到握手请求,用netstat命令查,没有找到8000端口,c++服务器监听的端口找不到,但是能收到c++客户端的请求。

sql2005 为什么启动了 通过netstat命令 看不到所开端口号!

修改了默认端口为4321,可通过命令看不到,JDBC连接时出现 socket错误。。。。

ubuntu运行openoffice 监听不到?

为什么在ubuntu中运行了 “soffice --accept="socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --norestore --nofirststartwizard --nologo --headless &”后,在ps进程中有soffice,但却在netstat -a中看不到8100端口,用jodconverter也提示连接不到这个openoffice服务。

win7,端口怎么打开?

win7 防火墙已建立出站和入站规则,例如特定端口设为8056,打开防火墙,显示该端口是启用状态,但是用cmd输入 netstat -ano 为什么显示活跃端口没有8056,要怎么样设置才可以??请各位大神指点

求助,linux进行被kill后端口仍然处于监听状态,一直释放不了该怎么办

昨天同事在更新重启服务时启动不了,我上去看了下日志是端口占用,本来想这很简单阿,杀掉进程不就OK了吗。 于是用netstat查看了以下,结果傻眼了,端口处于监听状态,进程ID却没有,试了lsof也找不到进程ID。问了下同事,他当时是使用kill没有加—9参数杀进程的。 后来网上看到有说用tcpkill可以断开连接释放端口,也尝试了,依然没用。系统是Red Hat 4.8.5-28,下面是具体的操作结果 首先看下正常的端口7711,可以看到进程编号 ```sh [root@host1]# netstat -an|grep 7711 tcp 0 0 0.0.0.0:7711 0.0.0.0:* LISTEN [root@host1]# netstat -anp|grep 7711 tcp 0 0 0.0.0.0:7711 0.0.0.0:* LISTEN 15720/java ``` 再来看看异常的端口7751,用netstat -anp没有任何结果,netstat -an可以看到端口仍然处于监听状态 ```sh [root@host1]# netstat -anp|grep 7751 [root@host1]# netstat -an|grep 7751 tcp 0 0 0.0.0.0:7751 0.0.0.0:* LISTEN #使用lsof查看的结果 [root@host1]# lsof -i:7711 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 15720 root 22u IPv4 286355217 0t0 TCP *:7711 (LISTEN) [root@host1]# lsof -i:7751 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME [root@host]# [root@host1]# tcpkill -9 port 7751 tcpkill: listening on eth0 [port 7751] ^C [root@host1# netstat -an|grep 7751 tcp 0 0 0.0.0.0:7751 0.0.0.0:* LISTEN [root@host1]# ``` 现在只有想到重启这条路,但是重启的话又比较麻烦。希望哪位知道这个问题的大佬给指点指点,不重启的情况下有没有办法

如何查看一个端口是否被占用

网上搜了下关于查找端口是否被占用的命令,如下: netstat -ano|findstr "端口" 但是我去看了netstat的各个参数,以及搜索了些其他知识后,我的理解是这样的: 1,参数o是显示建立连接的端口号的进程ID。 2,同一个端口最好不要(也有说不能的)被多个程序拿来监听。 那么我想问一下: 1,端口占用的界定。如果一个端口已经被一个程序拿去做为监听端口,现在我想用这个端口做监听端口,这个端口算不算被占用? 2,通过网上给出的-ano参数,查出的应该是不包含关于监听端口的内容吧?

netstat之后服务器端显示查询的链接已经没有啦,但客户端仍然显示 ESTABLISHED ??

如题目,服务器端网络层使用了libevent,丢失这种连接之后收不到任何事件。

Php-fpm不会监听端口

<div class="post-text" itemprop="text"> <p>I have been trying to get php-fpm (w nginx) to work with the default port(9000) and it just does not work.I am trying to use php 7.1 (also tried 7.0 and 5.6). The service started fine and I can also see the port open and being listened in ss/netstat. There are no errors in the php-fpm log. Initially I thought it could be an nginx issue, But when I try to test the connection directly using cgi-fcgi -bind -connect 127.0.0.1:9000 it just does not respond and I eventually get a could not connect error. The request doesnot get logged in the access log (when access log enabled).</p> <pre><code> # cgi-fcgi -bind -connect 127.0.0.1:9000 Could not connect to 127.0.0.1:9000 </code></pre> <p>And some times after a restart it just randomly works for a few requests (sometimes 1 request, sometimes 10, varies) and then it just stops working again. The request count in the php-fpm status no longer increases. There is no rhyme or rythm to its behaviour and I could not find a consistent way to get it to work even for those few requests.<br> The issue has been haunting me for 2 days now and its soo inconsistent with nothing in logs. Please help. Thanks for the replies in advance.</p> <p><br> <br> <strong>What I tried so far -</strong> </p> <ol> <li>Tested with nginx to make sure that its not <em>cgi-fcgi</em> issue. Same problem in nginx too could not connect to upstream.</li> <li>Setting the php-fpm log level to debug to see if something pops up. Nothing out of the ordinary found.</li> <li>Enabling access log to see if the request atleast reaches php-fpm. <em>No entry in the access log for the failed requests.</em></li> <li>Changed <em>listen</em> value to 9000 and 0.0.0.0:9000 and the external_ip:9000. All of these changes didnot change the behaviour.</li> <li>Changed to other ports to ensure its not the port number being in use.</li> <li>Increased and decreased <em>pm.start_servers</em> along with other related values to check if its processes running out. Didnot effect, infact all process just idle all the time.</li> <li>Removing and re installing php-fpm</li> <li>Resetting the config to ensure its not a config issue</li> <li>Installing php-fpm from remi repo instead of webstatic repo to ensure its not a bad build</li> <li>Downgrading to php 7.0</li> <li>Stopping all other services to make sure there are no conflicts or alike</li> <li>Change listen.allowed_clients to 'any' to make sure that its not the client being rejected</li> <li>Nuked the server and reinstalled the OS itself to ensure that its not an OS issue after trying multiple things for 2 days straight. (Empty server with no data)</li> <li>It does work absolutely fine with a unix socket instead of port. But a socket will not work for the requirement as if it needs to get anything more than a 100 rows from mysql, I noticed it to just timeout (&gt; 30s) in socket mode.</li> </ol> <p><br> <br></p> <p><strong>Information &amp; Config Below</strong></p> <p>Operating System - CentOS 7</p> <p>PHP-FPM Service status</p> <pre><code> #service php-fpm status Redirecting to /bin/systemctl status php-fpm.service * php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled) Active: active (running) since Sun 2017-04-16 17:12:06 EDT; 14s ago Main PID: 2392 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/php-fpm.service |-2392 php-fpm: master process (/etc/php-fpm.conf) |-2393 php-fpm: pool www |-2394 php-fpm: pool www |-2395 php-fpm: pool www |-2396 php-fpm: pool www `-2397 php-fpm: pool www Apr 16 17:12:06 2740.servermania.com systemd[1]: Starting The PHP FastCGI Pr.... Apr 16 17:12:06 2740.servermania.com systemd[1]: Started The PHP FastCGI Pro.... Hint: Some lines were ellipsized, use -l to show in full. </code></pre> <p>Socketstat / netstat . (Last one is php-fpm)</p> <pre><code> # ss -tapn State Recv-Q Send-Q Local Address:Port Peer Address:Port Cannot open netlink socket: Protocol not supported LISTEN 0 0 *:111 *:* users:(("rpcbind",pid=1588,fd=4),("systemd",pid=1,fd=42)) LISTEN 0 0 *:80 *:* users:(("httpd",pid=1871,fd=3),("httpd",pid=1870,fd=3)) LISTEN 0 0 *:22 *:* users:(("sshd",pid=1512,fd=3)) LISTEN 0 0 127.0.0.1:25 *:* users:(("sendmail",pid=416,fd=4)) LISTEN 0 0 127.0.0.1:9000 *:* users:(("php-fpm",pid=2397,fd=0),("php-fpm",pid=2396,fd=0),("php-fpm",pid=2395,fd=0),("php-fpm",pid=2394,fd=0),("php-fpm",pid=2393,fd=0),("php-fpm",pid=2392,fd=6)) </code></pre> <p>The default php-fpm config I am currently trying to get to work.( My config is not working, hence trying to get it to work atleast in default). </p><pre><code>; Start a new pool named 'www'. [www] <pre><code>; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = apache ; RPM: Keep a group allowed to write in log dir. group = apache ; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on ; a specific port; ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses ; (IPv6 and IPv4-mapped) on a specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = 127.0.0.1:9000 ; Set listen(2) backlog. ; Default Value: 511 (-1 on FreeBSD and OpenBSD) ;listen.backlog = 511 ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many ; BSD-derived systems allow connections regardless of permissions. ; Default Values: user and group are set as the running user ; mode is set to 0660 ;listen.owner = nobody ;listen.group = nobody ;listen.mode = 0660 ; When POSIX Access Control Lists are supported you can set them using ; these options, value is a comma separated list of user/group names. ; When set, listen.owner and listen.group are ignored ;listen.acl_users = ;listen.acl_groups = ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; must be separated by a comma. If this value is left blank, connections will be ; accepted from any ip address. ; Default Value: any listen.allowed_clients = any ; Specify the nice(2) priority to apply to the pool processes (only if set) ; The value can vary from -19 (highest priority) to 20 (lower priority) ; Note: - It will only work if the FPM master process is launched as root ; - The pool processes will inherit the master process priority ; unless it specified otherwise ; Default Value: no set ; process.priority = -19 ; Choose how the process manager will control the number of child processes. ; Possible Values: ; static - a fixed number (pm.max_children) of child processes; ; dynamic - the number of child processes are set dynamically based on the ; following directives. With this process management, there will be ; always at least 1 children. ; pm.max_children - the maximum number of children that can ; be alive at the same time. ; pm.start_servers - the number of children created on startup. ; pm.min_spare_servers - the minimum number of children in 'idle' ; state (waiting to process). If the number ; of 'idle' processes is less than this ; number then some children will be created. ; pm.max_spare_servers - the maximum number of children in 'idle' ; state (waiting to process). If the number ; of 'idle' processes is greater than this ; number then some children will be killed. ; ondemand - no children are created at startup. Children will be forked when ; new requests will connect. The following parameter are used: ; pm.max_children - the maximum number of children that ; can be alive at the same time. ; pm.process_idle_timeout - The number of seconds after which ; an idle process will be killed. ; Note: This value is mandatory. pm = dynamic ; The number of child processes to be created when pm is set to 'static' and the ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. ; This value sets the limit on the number of simultaneous requests that will be ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP ; CGI. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' ; Note: This value is mandatory. pm.max_children = 50 ; The number of child processes created on startup. ; Note: Used only when pm is set to 'dynamic' ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 pm.start_servers = 5 ; The desired minimum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' pm.min_spare_servers = 5 ; The desired maximum number of idle server processes. ; Note: Used only when pm is set to 'dynamic' ; Note: Mandatory when pm is set to 'dynamic' pm.max_spare_servers = 35 ; The number of seconds after which an idle process will be killed. ; Note: Used only when pm is set to 'ondemand' ; Default Value: 10s ;pm.process_idle_timeout = 10s; ; The number of requests each child process should execute before respawning. ; This can be useful to work around memory leaks in 3rd party libraries. For ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 ;pm.max_requests = 500 ; The URI to view the FPM status page. If this value is not set, no URI will be ; recognized as a status page. It shows the following informations: ; pool - the name of the pool; ; process manager - static, dynamic or ondemand; ; start time - the date and time FPM has started; ; start since - number of seconds since FPM has started; ; accepted conn - the number of request accepted by the pool; ; listen queue - the number of request in the queue of pending ; connections (see backlog in listen(2)); ; max listen queue - the maximum number of requests in the queue ; of pending connections since FPM has started; ; listen queue len - the size of the socket queue of pending connections; ; idle processes - the number of idle processes; ; active processes - the number of active processes; ; total processes - the number of idle + active processes; ; max active processes - the maximum number of active processes since FPM ; has started; ; max children reached - number of times, the process limit has been reached, ; when pm tries to start more children (works only for ; pm 'dynamic' and 'ondemand'); ; Value are updated in real time. ; Example output: ; pool: www ; process manager: static ; start time: 01/Jul/2011:17:53:49 +0200 ; start since: 62636 ; accepted conn: 190460 ; listen queue: 0 ; max listen queue: 1 ; listen queue len: 42 ; idle processes: 4 ; active processes: 11 ; total processes: 15 ; max active processes: 12 ; max children reached: 0 ; ; By default the status page output is formatted as text/plain. Passing either ; 'html', 'xml' or 'json' in the query string will return the corresponding ; output syntax. Example: ; http://www.foo.bar/status ; http://www.foo.bar/status?json ; http://www.foo.bar/status?html ; http://www.foo.bar/status?xml ; ; By default the status page only outputs short status. Passing 'full' in the ; query string will also return status for each pool process. ; Example: ; http://www.foo.bar/status?full ; http://www.foo.bar/status?json&amp;full ; http://www.foo.bar/status?html&amp;full ; http://www.foo.bar/status?xml&amp;full ; The Full status returns for each process: ; pid - the PID of the process; ; state - the state of the process (Idle, Running, ...); ; start time - the date and time the process has started; ; start since - the number of seconds since the process has started; ; requests - the number of requests the process has served; ; request duration - the duration in 袖s of the requests; ; request method - the request method (GET, POST, ...); ; request URI - the request URI with the query string; ; content length - the content length of the request (only with POST); ; user - the user (PHP_AUTH_USER) (or '-' if not set); ; script - the main script called (or '-' if not set); ; last request cpu - the %cpu the last request consumed ; it's always 0 if the process is not in Idle state ; because CPU calculation is done when the request ; processing has terminated; ; last request memory - the max amount of memory the last request consumed ; it's always 0 if the process is not in Idle state ; because memory calculation is done when the request ; processing has terminated; ; If the process is in Idle state, then informations are related to the ; last request the process has served. Otherwise informations are related to ; the current request being served. ; Example output: ; ************************ ; pid: 31330 ; state: Running ; start time: 01/Jul/2011:17:53:49 +0200 ; start since: 63087 ; requests: 12808 ; request duration: 1250261 ; request method: GET ; request URI: /test_mem.php?N=10000 ; content length: 0 ; user: - ; script: /home/fat/web/docs/php/test_mem.php ; last request cpu: 0.00 ; last request memory: 0 ; ; Note: There is a real-time FPM status monitoring sample web page available ; It's available in: @EXPANDED_DATADIR@/fpm/status.html ; ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set pm.status_path = /status ; The ping URI to call the monitoring page of FPM. If this value is not set, no ; URI will be recognized as a ping page. This could be used to test from outside ; that FPM is alive and responding, or to ; - create a graph of FPM availability (rrd or such); ; - remove a server from a group if it is not responding (load balancing); ; - trigger alerts for the operating team (24/7). ; Note: The value must start with a leading slash (/). The value can be ; anything, but it may not be a good idea to use the .php extension or it ; may conflict with a real PHP file. ; Default Value: not set ping.path = /ping ; This directive may be used to customize the response of a ping request. The ; response is formatted as text/plain with a 200 response code. ; Default Value: pong ;ping.response = pong ; The access log file ; Default: not set access.log = /var/log/php-fpm/access.log ; The access log format. ; The following syntax is allowed ; %%: the '%' character ; %C: %CPU used by the request ; it can accept the following format: ; - %{user}C for user CPU only ; - %{system}C for system CPU only ; - %{total}C for user + system CPU (default) ; %d: time taken to serve the request ; it can accept the following format: ; - %{seconds}d (default) ; - %{miliseconds}d ; - %{mili}d ; - %{microseconds}d ; - %{micro}d ; %e: an environment variable (same as $_ENV or $_SERVER) ; it must be associated with embraces to specify the name of the env ; variable. Some exemples: ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e ; %f: script filename ; %l: content-length of the request (for POST request only) ; %m: request method ; %M: peak of memory allocated by PHP ; it can accept the following format: ; - %{bytes}M (default) ; - %{kilobytes}M ; - %{kilo}M ; - %{megabytes}M ; - %{mega}M ; %n: pool name ; %o: output header ; it must be associated with embraces to specify the name of the header: ; - %{Content-Type}o ; - %{X-Powered-By}o ; - %{Transfert-Encoding}o ; - .... ; %p: PID of the child that serviced the request ; %P: PID of the parent of the child that serviced the request ; %q: the query string ; %Q: the '?' character if query string exists ; %r: the request URI (without the query string, see %q and %Q) ; %R: remote IP address ; %s: status (response code) ; %t: server time the request was received ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) ; The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %T: time the log has been written (the request has finished) ; it can accept a strftime(3) format: ; %d/%b/%Y:%H:%M:%S %z (default) ; The strftime(3) format must be encapsuled in a %{&lt;strftime_format&gt;}t tag ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t ; %u: remote user ; ; Default: "%R - %u %t \"%m %r\" %s" ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set slowlog = /var/log/php-fpm/www-slow.log ; The timeout for serving a single request after which a PHP backtrace will be ; dumped to the 'slowlog' file. A value of '0s' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 ;request_slowlog_timeout = 0 ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) ; Default Value: 0 ;request_terminate_timeout = 0 ; Set open file descriptor rlimit. ; Default Value: system defined value ;rlimit_files = 1024 ; Set max core size rlimit. ; Possible Values: 'unlimited' or an integer greater or equal to 0 ; Default Value: system defined value ;rlimit_core = 0 ; Chroot to this directory at the start. This value must be defined as an ; absolute path. When this value is not set, chroot is not used. ; Note: chrooting is a great security feature and should be used whenever ; possible. However, all PHP paths will be relative to the chroot ; (error_log, sessions.save_path, ...). ; Default Value: not set ;chroot = ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot ;chdir = /var/www ; Redirect worker stdout and stderr into main error log. If not set, stdout and ; stderr will be redirected to /dev/null according to FastCGI specs. ; Note: on highloaded environement, this can cause some delay in the page ; process time (several ms). ; Default Value: no ;catch_workers_output = yes ; Clear environment in FPM workers ; Prevents arbitrary environment variables from reaching FPM worker processes ; by clearing the environment in workers before env vars specified in this ; pool configuration are added. ; Setting to "no" will make all environment variables available to PHP code ; via getenv(), $_ENV and $_SERVER. ; Default Value: yes ;clear_env = no ; Limits the extensions of the main script FPM will allow to parse. This can ; prevent configuration mistakes on the web server side. You should only limit ; FPM to .php extensions to prevent malicious users to use other extensions to ; exectute php code. ; Note: set an empty value to allow all extensions. ; Default Value: .php ;security.limit_extensions = .php .php3 .php4 .php5 .php7 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; the current environment. ; Default Value: clean env ;env[HOSTNAME] = $HOSTNAME ;env[PATH] = /usr/local/bin:/usr/bin:/bin ;env[TMP] = /tmp ;env[TMPDIR] = /tmp ;env[TEMP] = /tmp ; Additional php.ini defines, specific to this pool of workers. These settings ; overwrite the values previously defined in the php.ini. The directives are the ; same as the PHP SAPI: ; php_value/php_flag - you can set classic ini defines which can ; be overwritten from PHP call 'ini_set'. ; php_admin_value/php_admin_flag - these directives won't be overwritten by ; PHP call 'ini_set' ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. ; Defining 'extension' will load the corresponding shared extension from ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not ; overwrite previously defined php.ini values, but will append the new value ; instead. ; Default Value: nothing is defined by default except the values in php.ini and ; specified at startup with the -d argument ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com ;php_flag[display_errors] = off php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on ;php_admin_value[memory_limit] = 128M ; Set session path to a directory owned by process user php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/php/session php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache </code></pre> <p></p></code></pre> <p>PHP-FPM Error log</p> <pre><code> [16-Apr-2017 17:12:06] NOTICE: fpm is running, pid 2392 [16-Apr-2017 17:12:06] NOTICE: ready to handle connections [16-Apr-2017 17:12:06] NOTICE: systemd monitor interval set to 10000ms </code></pre> <p>Telnet output</p> <pre><code> # telnet 127.0.0.1 9000 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection timed out </code></pre> </div>

Tomcat正常启动,但是端口没有被监听,请问是怎么回事!求大神指教!

Linux环境下,tomcat启动后,log没有报错,但是 Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:42122 *:* LISTEN tcp 0 0 *:22 *:* LISTEN tcp 0 0 localhost:25 *:* LISTEN tcp 0 0 *:1180 *:* LISTEN 并没有发现80端口

ecplise Java中用ServerSocket监听端口问题

端口号为60012,java的PID为4036,只启用了一个ServerSocket。打开cmd并netstat -aon|findstr "60012"后,发现有两个地址?这是为什么?谢谢各位大神了 ![图片说明](https://img-ask.csdn.net/upload/201602/21/1456036023_903875.png) ![图片说明](https://img-ask.csdn.net/upload/201602/21/1456035860_350548.png)

网站服务器80端口被攻击

我的服务器上网站部署的时候,配置为80端口时,网站访问特别慢。但是换个端口号,访问就很快。我通过命令查询netstat -a -n -o。![图片说明](https://img-ask.csdn.net/upload/201702/20/1487549782_182441.png), 这是怎么回事啊?如何解决。急等!!!谢谢

mysql 端口号 本地连接?

ctrl+r cmd netstat -ano 展示的本地地址三种 0.0.0.0:端口号 127.0.0.1:端口号 ip:端口号 问题1 这三个之间有什么区别 0.0.0.0 我在网上搜到的说的是一个保留ip 我想问的是 这个是否表示 0.0.0.0:3306 这个端口可以被外部的计算机访问 127.0.0.1 我再网上搜到的是本地相当于localhost 这个是否表示 127.0.0.1:3306 这个端口号只能在本地访问 ip(本机ip) 这个是否表示 ip:3306 这个端口号只能通过这个ip的端口来进行访问

安装nginx-rtmp-module后配置的端口1935没有被监听

安装完nginx和nginx-rtmp-module模块 在nginx.conf文件最后添加 rtmp { server { listen 1935; #监听的端口 chunk_size 4000; application hls { #rtmp推流请求路径 live on; hls on; hls_path /home/hls; hls_fragment 5s; } } } 重新启动nginx,没有报错。 输入命令netstat -ntlp 发现1935端口并没有被监听 ![图片说明](https://img-ask.csdn.net/upload/202002/09/1581229261_111218.png) 。 解决:配置完nginx.conf后,重启服务器,再开启nginx ![图片说明](https://img-ask.csdn.net/upload/202002/10/1581301704_356529.jpg)

linux中netstat某个瞬间值不准确,求大神指点

使用netstat监控端口时,连续两次查看的端口状态不一致,实际上这个端口应该是一直连接这的。 下面是我的bash监控脚本: for((i=0; i<3; i++)) do netstat -an|grep $locPort >$TMPFILE count=`cat $TMPFILE|grep ESTABLISHED|awk '{print $4}'|grep $locPort|wc -l` count1=`cat $TMPFILE|grep LISTEN| awk '{print $4}'|grep $locPort|wc -l` count2=`cat $TMPFILE|awk '{print $4}'|grep $locPort|wc -l` local msgBuf1=0 local msgBuf2=0 msgBuf1=`cat $TMPFILE|awk '{print $2,$3,$4,$6}' |grep $locPort|grep ESTABLISHED|awk '{print $1}'` msgBuf2=`cat $TMPFILE|awk '{print $2,$3,$4,$6}' |grep $locPort|grep ESTABLISHED|awk '{print $2}'` msgBuf1=${msgBuf1:-0} msgBuf2=${msgBuf2:-0} if [ $count -eq 1 -a $count1 -eq 1 -a $count2 -eq 2 -a $msgBuf1 -eq 0 -a $msgBuf2 -eq 0 ] ;then status="OK" break else status="ERROR" cat $TMPFILE >&3 echo "++++++++++++++++++++" >&3 netstat -an|grep $locPort >&3 echo "sleep 1s" sleep 1s continue fi done 下面是输出内容: tcp 0 0 10.5.177.44:20203 0.0.0.0:* LISTEN tcp 0 0 ::ffff:10.5.177.44:12184 ::ffff:10.5.177.44:20203 ESTABLISHED ++++++++++++++++++++ tcp 0 0 10.5.177.44:20203 0.0.0.0:* LISTEN tcp 0 0 10.5.177.44:20203 10.5.177.44:12184 ESTABLISHED tcp 0 0 ::ffff:10.5.177.44:12184 ::ffff:10.5.177.44:20203 ESTABLISHED 该监控程序大部分时候都是正常的,但是偶然性会出现上面这种情况,sleep1秒后端口状态又正常了,应用程序是长连接,这期间应用也是正常的。求大神指点。

【java调试】根据jps显示的pid,无法通过netstat找到对应端口?

这样,我在电脑上写了一个java程序,使用javac编译运行,然后jps显示如下 ``` [root@jamie-hadoop ~]# jps 3851 org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar 8700 -- process information unavailable 6461 Hanoi 6558 Jps ``` Hanoi是我的程序,我现在通过netstat -aux | grep 6461想查看对应的段口号,但是结果如下 ``` [root@jamie-hadoop ~]# netstat -aux | grep 6461 [root@jamie-hadoop ~]# ``` 没有任何内容,然后我换了一个命令lsof -i | grep 6461 依旧不行,这是为什么?不是pid绑定在端口号上么?

linux中使用命令netstat查看udp端口为空的问题

博主用netstat命令查看,其中包含tcp端口和udp端口,tcp处于listen状态,udp状态为空,命令“netstat -anp | grep :3478” tcp 0 0 x.x.x.x:3478 0.0.0.0:* LISTEN 15213/turnserver udp 0 0 x.x.x.x:3478 0.0.0.0:* 15213/turnserver 请问各位大佬,对于udp端口的状态为空是什么情况,多谢哈

Oracle无法启动监听服务

在计算机服务里面启动Oracle监听服务,错误提示是: ![图片说明](https://img-ask.csdn.net/upload/201803/05/1520252867_790352.jpg) 本地计算机上的OracleOraDB12Home2TNSListener服务启动后停止,某些服务在未由其他服务或程序使用时即将自动停止。 网上很多答案都过,包括将host和监听文件listener.ora里的地址改成计算机的名称或者ip地址,注册表检查过imagepath文件的地址(是TNSLSNR文件所在的路径)也是没错的。也试过把监听文件删除再重新配置。 疑点:在把监听文件删除后再重新配置,出现提示端口1521被占用,使用netstat -aon|findstr查看端口1521并没有被占用,换了几个端口也是同样提示,不知道监听服务无法启动是否于此有关。 如何去解决?新手,刚下载,已经摸索了两天,虚心求教。

mysql安装后用netstat -an怎么没有localhost或者127.0.0.1

mysql安装后用netstat -an怎么没有localhost或者127.0.0.1,安装的时候改了端口号![图片说明](https://img-ask.csdn.net/upload/201508/05/1438735530_316058.png) 补充:我是在虚拟机下面安装的

centos7 添加端口死活不生效

我在自己电脑上虚拟了一台centos7,需要添加2888和3888这两个端口。 当前zone是public [root@cent129 /]# firewall-cmd --get-active-zones public interfaces: ens33 添加端口 [root@cent129 /]# firewall-cmd --zone=public --add-port=2888/tcp --permanent success 刷新 [root@cent129 /]# firewall-cmd --reload 查看已添加的端口列表 [root@cent129 /]# firewall-cmd --zone=public --list-ports 3888/tcp 2888/tcp 但是测试无效 [root@cent129 /]# telnet 127.0.0.1 2888 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused 而且执行netstat -apn|grep '2888' 找不到任何信息

windows访问不了VMWare的docker映射的端口

最近在入门docker,我的电脑是win10家庭版,没有hyper,boot2docker也用不了 就自己在VMWare里面装了个ubuntu16.04 用apt-get 装了个docker.io 下载了一个redis镜像,用docker run -d -p 6379:6379 --name myredis redis后 ubuntu本地netstat -an | grep 6379 tcp6 0 0 :::6379 :::* LISTEN 但是windows本地访问不到这个端口 我在VMWare配置的网络连接是“仅主机模式”,换了其他的几个都不行 请问这个要怎么配置,才能使windows能访问本机VMWare里面虚拟机的端口 另外,请问redis的默认的账户密码是什么

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

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

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

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

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

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

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

和黑客斗争的 6 天!

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

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

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

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

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

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

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

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

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

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

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

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

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

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

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

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

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

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

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

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

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

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

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

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

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

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

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

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

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

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

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

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

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

立即提问
相关内容推荐