Archive for the ‘brokenpipe’ tag

summary of the socket error code (Windows and unix) (turn)

October 22, 2010
network 2010-10-2216:41:14 Read 0 Comments 0 Word Count: first look at the windows of statistical error in the code
query on the host, such as windows system, directly into the command line input: nethelpmsg1xxx can.
a network on-line error Socketerror # 11001
that your computer can not connect to server, please check your Proxy Settings and Proxy-related accounts, or suspension of your anti-virus software “personal firewall.”
a network on-line error Socketerror # 11004
should be the subject of networking online, please check the network connection is normal user.
a network on-line error Socketerror # 10060ConnectionTimedOut
that you and the server time-out error occurs online, please check your Proxy related settings, and whether it has SSL443port ProxyServer open.
a network on-line error Socketerror # 10061
indicates that the server is busy you can not set up online, please try again later.
a network on-line error Socketerror # 10022
Please update your Windows access control system components. WindowsNTversion4.0 users download and install ServicePack5 (or more).
appear InternalServerError
host is busy, please try again later.
upload when Socketerror # 10022Invalidargument.
Please update the Windows Internet control system components (windowsupdate). WindowsNTversion4.0 users download and install ServicePack5 (or more).
upload when socketerror # 10054Connectionresetbypeer
original mast as fire or proxy connection is interrupted, “or because you have installed the device set ip ip sharing device to share the first removed, computer connected directly to the adsl line and re-upload.
upload when socketerror # 10057Connectionresetbypeer
the original because the system file is corrupted, the system software, a firewall.
INDY9 development process feedback SocketErrors
Here is SocketError error code and description:
Socketerror0-Directlysenderror

Socketerror10004-Interruptedfunctioncall
Socketerror10013-Permissiondenied
Socketerror10014-Badaddress
Socketerror11001-Hostnotfound
Socketerror11002-Non-authoritativehostnotfound
Socketerror11003-Thisisanon-recoverableerror
Socketerror11004-Validname, nodatarecordofrequested type
WSAEADDRINUSE (10048) Addressalreadyinuse
WSAECONNABORTED ( 10053) Softwarecausedconnectionabor t
WSAECONNREFUSED (10061) Connectionrefused
WSAENETUNREACH (10051) Networkisunreachable
WSAETIMEDOUT (10060) Connectiontimedout

WSAHOST_NOT_FOUND (11001) Hostnotfound
WSASYSNOTREADY (10091) Networksub-systemisunavailabl e
WSANOTINITIALISED (10093) WSAStartup () notperformed
WSANO_DATA (11004) Validname, nodataofthattype
WSANO_RECOVERY (11003) Non-recoverablequeryerror
WSATRY_AGAIN (11002) Non-authoritativehostfound
WSAVERNOTSUPPORTED (10092) WrongWinSockDLLversion
unix platform error code, available online is relatively small, looking for a fairly complete 10001 EPERM Notsuper-user 10002 ENOENT Nosuchfileordirectory 1000 3 < o: p> ESRCH Nosuchprocess 10004 EINTR interruptedsystemcall 10005 EIO I / Oerror 10006 ENXIO Nosuchdeviceoraddress 10007 E2BIG Arglisttoolong 10008 ENOEXEC Exe cformaterror 10009 EBADF Badfilen umber 10010 ECHILD Nochildren 10011 EAGAIN Nomoreprocesses 1 0012 ENOMEM Notenoughcore 10013 EACCES Permissiondenied 10014 EFAULT Badaddress 10015 ENOTBLK Blockdevicerequired 10016 EBUSY Mountdevicebusy 10017 EEXIST Fileexists 10018 < / o: p> EXDEV Cross-de vicelink 10019 ENODEV Nosuchdevic e 10020 ENOTDIR Notadirectory < / o: p> 10021 EISDIR Isadirectory 1002 2 EINVAL Invalidargument 10023 ENFILE Filetableoverflow 10024 EMFILE Toomanyopenfiles 10025 E NOTTY Notatypewriter 10026 ETXTBS Y Textfilebusy 10027 EFBIG Filetoolarge < o: p> 10028 ENOSPC Nospace leftondevice 10029 ESPIPE Illegal seek 10030 EROFS Readonlyfilesyst em 10031 EMLINK Toomanylinks 10032 EPIPE Brokenpipe 10033 < / o: p> 10034 10035 ENOMSG Nomessageofdesiredtype 1003 6 < o: p> EIDRM Identifierremoved 10037 ECHRNG Channelnumberoutofrange

Posted: January 7th, 2012
at 7:46am by admin

Tagged with


Categories: Uncategorized

Comments: No comments


JavaSocket common exception handling

October 28, 2010
Socket Communications, the daily encounter the following exceptions:
first one exception is java.net.BindException: Addressalreadyinuse: JVM_Bin d.
The exception occurs in the offices of device side newServerSocket (port) (port is an integer value 0,65536) operation. Notice is that with the exception of the port as a port has been activated, and eavesdropping. Netstat-an then with the Royal Decree, you can see the status of a Listending port. Only to find a port that is not occupied can solve the problem.
second exception is java.net.ConnectException: Connectionrefused: connec t.
The exception occurs on the client side newSocket (ip, port) operation, the exception is generated notices or ip address of the machine with less than her inability to find (that is, from the current machine does not exist to specify the ip route) or the ip there, but could not find the specified port for monitoring. The problem occurs, check the beginning of the client ip and port is not wrong, if accurate work from the client ping the device is not able to ping to see if can ping (ping work to ban drop-side is not required of the method), then look in the offices of the specified port-side of the monitor is not the testimony of the model, then this can be determined to solve this problem.
The third exception is java.net.SocketException: Socketisclosed.
the exception on the client device and the work may generate. Notice is the unusual initiative to end the connection is closed (called Socket close method) and then connect to the collection of read and write operations.
fourth exception is java.net.SocketException: (Connectionreset or Connectresetbypeer: Socketwriteerror).
the exception on the client and server-side things are possible, cause notice of the exception of two, the first is if the Socket is closed at one end (or active or closed because of abnormal exit caused closed), the other end is still sending data, the first packet sent to stimulate the exception (Connectresetbypeer). Another is the end of the exit, but exit when the connection is not closed, the other end if the connection to read data from the Thrown (Connectionreset). Simply means that the connection is lost after the read and write operations triggered.
fifth exception is java.net.SocketException: Brokenpipe.
the exception on the client, and work devices are likely to generate. In the first four exceptions in the first case (that is thrown SocketExcepton: Connectresetbypeer: Socketwriteerror later), and then continued to write the data if the exception is thrown. The first two exceptions beginning of the solution is to ensure that all the testimonies example out of the collection before the connection closed, followed by the other side closed connection to testing operation, the invention itself should also be connection to the other side closed the connection closed.
two. Example, when writing to collect testimonies have attention problems:
1, is to accurately identify the long and short connection. Connection is the so-called long been established on a permanent hold. Connection is short, preparation of data -> Connect -> send data -> closed connection. Many members of the testimony of the model for many years wrote a collection of testimonies example, does not even know what a long connection, what is the short connection.
2, is a long connection protection. The so-called protection consists of two aspects, beginning of the initiative is to test each other disconnection (ie, calling Socket close method), followed by testing each other down, exception exit and collect unreasonable. This is a strong testimony of the communication model must have. Detect each other active disconnection is simple, even an important one-off initiative, if the other party during the read operation, then the return value of -1 only once to detect each other off with, you should take the initiative to close the end of the connection (called Socket The close method). And testing each other down, and collecting unusual exit barrier, often applied method is to use a “heartbeat”, which is on both sides periodically send data to each other, but also from each other to receive a “heartbeat”, if the last few cycles have not received to each other heartbeat, you can conclude that the other side down, exception exit or collect unreasonable at this time also need to take the initiative to close local connection, if the client can be one accurate time delay after the connection from the new proposal. Socket has a keepalive option of course to protect the connection, if using this option, the invention generally have two hours to each other down, and collecting unusual exit barrier.
3, dealing with effectiveness. Whether the client devices still work, if the model is a long testimony of at least a need to connect two threads, one for receiving data, one for sending heartbeat, do not have to write a special thread, of course, also have a class of other threads ( commonly known as the Worker thread) for message processing, that is only responsible for receiving thread to receive data, and then distributed to Worker for data processing. If it is a short connection, no need to send the heartbeat thread, if the device is also required to act in a dedicated thread responsible for listening for connection requests. These are the testimonies of a communication model of the overall request, the specific example of your testimonies, the testimonies to see you Ruo model for optimization of.

Posted: January 7th, 2012
at 7:46am by admin

Tagged with


Categories: Uncategorized

Comments: No comments


mgaor

October 31, 2010
collection of programming in java Socket communication, the weekdays will be closed on the following exceptions:
first one exception is java.net.BindException: Addressalreadyinuse : JVM_Bin d.
The exception generated in the side newServerSocket (port) (port is an integer value 0,65536) control time. Notice is that with the exception of the port as a port has been activated, and eavesdropping. Netstat-an then with the Royal Decree, you can see the status of a Listending port. Only to find a port that is not occupied can resolve the title of.
second exception is java.net.ConnectException: Connectionrefused: connec t.
The exception occurs on the client side newSocket (ip, port) control, the exception is generated notices or ip address of the machine with less than her inability to find (that is, from the current machine does not exist to specify the ip route) or the ip there, but could not find the specified port for monitoring. Appear in the title, check the beginning of the client ip and port is not wrong, it is assumed accurate ping from the client side of the monitor about the testimony of the specified port model is not activated, the determination to solve this title.
The third exception is java.net.SocketException: Socketisclosed.
the exception on the client and are likely to arise. Notice is the unusual side closed the connection active (call the close method of the Socket) and then connect to the collection of read and write control.
fourth exception is java.net.SocketException: (Connectionreset or Connectresetbypeer: Socketwriteerror).
The exception in both the client and the client may have led to notice the exception of two, the first is to assume that the Socket is closed at one end (or take the initiative to shut down or quit because of abnormalities caused by close ), the other end is still sending data, the first packet sent to stimulate the exception (Connectresetbypeer). Another is the end of the exit, but did not close the connection when exiting the other end of the connection is assumed to read data from the Thrown (Connectionreset). Simply means that the connection is lost after the read and write control triggered.
fifth exception is java.net.SocketException: Brokenpipe.
the exception on the client and are likely to generate. In the first four exceptions in the first case (that is thrown SocketExcepton: Connectresetbypeer: Socketwriteerror later), assuming continued to write data is re-thrown. The first two exceptions to ensure the beginning of the solution is to close all testimonies example out of the collection of connections, followed by testing each other close connection to control, the other side closes the connection after the invention itself should close the connection.
two. Written testimony of role models need to carefully collect the title:
1, is to accurately identify the long and short connection. Connection is the so-called long been established on a permanent hold. Connection is short, preparing data -> Connect -> send data -> close the connection. Many members of the testimony of the model for many years wrote a collection of testimonies example, does not even know what a long connection, what is the short connection.
2, is a long connection protection. The so-called protection consists of two aspects, beginning of the initiative is to test each other disconnection (ie, calling Socket close method), followed by testing each other down, exception exit and collect unreasonable. This is a solid example of the necessary communication with the testimonies. Detect each other active disconnection is simple, even an important one-off initiative, the other party assumes control during reading, then the return value is -1 only once to detect each other off with, you should take the initiative off the side of the connection (called Socket The close method). And testing each other down, and collecting unusual exit barrier, often applied method is to use a “heartbeat”, which is on both sides periodically send data to each other, but also from each other to receive a “heartbeat”, assuming that last a few cycles are not closed heartbeat to the other side, you can sever the other down, or collect abnormal exit barrier, this time also need to take the initiative to close the client connection, the client can assume that one accurate time delay after the connection from the new proposal. Although there is a Socket connection keepalive option to protect, it is assumed that this option, the invention generally have two hours to each other down, and collecting unusual exit barrier.
3, dealing with the effectiveness of the title. Whether the client still is assumed to be a testimony of a long connection example at least have two threads, one for receiving data, one for sending heartbeat, do not have to write a special thread, although other classes also have a thread (commonly known as Worker thread) for message processing, that is only responsible for receiving thread to receive data, and then distributed to Worker for data processing. Connection is assumed to be short, no need to send the heartbeat thread, assuming that is also required is a dedicated thread responsible for listening for connection requests. These are the testimonies of a communication model of the overall request, the specific example of your testimonies, the testimonies to see you Ruo model for optimization of.

Posted: January 7th, 2012
at 7:46am by admin

Tagged with


Categories: Uncategorized

Comments: No comments


Help socket connect timeout issues, urgent !!!!!!!

September 1, 2011
important reminder: The system detects that your account may have stolen the risk, please see the risk warning as soon as possible, and immediately change your password. Close
Netease blog security alert: The system detected that your current password is less secure, for your account security, we recommend that you change your password immediately amend the timely closure
Help socket connect timeout issues, urgent! ! ! ! ! ! !
2011-09-01 01:28:01Category: Default CategoryTags:Subscribe to help medium and small font size socket connect timeout issues, emergency ! ! ! ! ! ! ! Hello, everyone, early name for chinaunix have heard, they often search for information on this, I point at the socket communication problems encountered, would like to ask next.
hardware platform: ARM9
software level control of network traffic problems TC units: ECOS network protocol stack (FreeBSD)
problem description:

two boards, one to run TCP socket Server (accept), a running TCP socket Client (connect), have access to a large network environment (the same floor of the local area network), a special issue of data, a special data collection, communication time can only be continued for several hours, and then there “BrokenPipe” and “ConnectResetByPeer” error, send, recv function returns -1 to quit. Then when I wanted to be an error in the program automatically re-connect them and then send and receive, that is, Client: the first close (sk), re-socket, connect, and Server-side has been a task accept, the results of the phenomenon is several times before re-connection process Client is to connect several times or ten times (the middle range of the delay time) to connect to later (a few hours later), both also Rom on how the ( TCP three-way handshake is not successful), tried many methods will not work (l_onoff = 1; l_linger = 0, and so on). Ecos connect later found under 7 seconds time-out, and found that regardless of the ARP request packet capture or TCP SYN, the two sides of the response is very slow (I do not know why), more than ten seconds after the other only reply is often a matter, so connect it is also not normal.
connect it to change the timeout, a common method: Set non-blocking socket, connect, set time, select., can be written to determine whether, getsockpot, but I find the value of time within the 7s are in effect, more than 7 seconds, are 7s, when select returns, in the ecos library is also looking for clues to no avail (probably does not even know)
problem is how to make connect timeout is greater than 7 seconds, and discussing it … we help to see what approach did not, thank you, my code is as follows http://dok77.xdq.gov.cn:
[code]
int skhttp: / / essvi.ballet.org.cn, ret;
struct timeval tv;
fd_set rdevents , wrevents;
if ((sk = socket (AF_INET, SOCK_STREAM, 0)) <0)
{
perror ("Socket build fail \ n ");
return ERROR;
}
if (ioctl (sk, FIONBIO,

Posted: January 7th, 2012
at 7:46am by admin

Tagged with


Categories: Uncategorized

Comments: No comments


Mastering Linux Bash call (transfer).

July 21, 2011
Transfer: spazzzz.blog.51cto.com/2707720/499923 enable root user using sudo passwd root user to disable the call using the passwd-lls [-adlsht]: Column the current directory reveals the non-hidden files-a directory of all files-d reveals itself to the list in the form-l-s reveal detailed information revealing the file size in blocks-h-t with a bearing unit according to the latest amendments to reveal something to reveal 3 in Linux kinds of work when rigorously enforce property atimeaccess change ctimechange read or change permissions, owners, when the number of links change when change mtimemodify amended cd PATH: change the current directory path to a monopoly return on the layer of PATH cd .. cd – back on the sequential use of return the user home directory cd directory, similar to the path cd ~ pwd reveals the current path of the current recommended changes call for a high-level: pushd PATH: place the directory stack, switch between multiple directories. Switching to the PATH directory, and the original directory and the PATH directory onto the stack to a fictitious; if you do not specify PATH, will return to the previous directory, and the last two directories in the stack to communicate. -N Do not change the current directory, the directory to stack NN represent numbers from 0 to switch to the directory dirs: Lists the current stack to retain the directory listing. Reveal the directory stack type-v-c empty stack popd: 0 pop-up in the directory stack. -N Do not change the current directory NN table numbers, pop-up the directory mkdir NAME: path created in the current folder NAMEtouch NAME: Founded in the current path taken lightly file NAMEmknod NAME: for the construction of P, B, C type NAME file cat [ -nb] NAME: NAME reveals the contents of the file in the terminal-n-b with the line number of blank lines are not numbered mv NAME1 NAME2: Rename the NAME1 NAME2rm file: remove file without confirmation-d Dir1 need to exclude directories Dir1 no need to confirm (the equivalent of DOS in the deltree). -I file1 (to remind the user to confirm later removed file1)-f file2 (file2 if ever exists, its contents covered in this call are not required to verify)-r * recursively remove files, in case there is a subdirectory the current directory, which is also excluded files and directories-rf xx xx directory excluding Linux file permissions chmod 751 test.java: harvest test.java permission is-rwxr-x – x, 7, said three user permissions are both 111, and is exactly 7 decimal; 5 into binary is 101, empathy is the other position of authority 1, is x rigorously enforce. Also able to use letters, u, g, o parting said three groups, and means reward, – said its efforts to abolish the directory permissions have the ability to open, but only the last directory in the directory have a sticky bit, otherwise it will inherit the parent to rigorously enforce the rights. Advanced permissions: drwxrwxrwtt said sticky bit, is to allow users to remove their own files can only assume that there have been in the position x, then these particular symbols (suid, sgid, sticky) reveals the lowercase letters (s, s, t ), otherwise, revealing for the capital letters (S, S, T) chmod a t xX specific sign Suid: set user id Sgid: set group id sTicky: sticky bit symbol is composed of three specific bits abc said, c that T, b said Sgid, a said Suideg: 101 of the document that set Suid and sTicky bit, even if the five specific octal permission bits of the sign bit on the front eg: a file test species identified as-rwxr-xrwx chmod 7747 harvest for the test-rwsr-Srwt 7747 111 111 100 111umask number equal to amend the default permissions created when the creation of the directory system of statutory authority to include rigorously enforce, and thus the maximum is 777; the default include file can not be rigorously enforce, and thus the maximum is 666. umask even if default permissions of the anti-code eg: umask = 022, the creation of the directory permissions are 755, file permissions are 644. umask = 002, the directory permissions are 775, 664 file permissions are used umask: 022:755 644027:750 640002:775 664006:771 660007:770 660groups username where username revealed that all groups and owner change file group called chown
chown [-cfhvR] user [: group] file …
-c were indeed if the file has been altered, it reveals its more adapted for
-f If you can not change, do not reveal and correct erroneous information
-h changes only at the file link, instead of pointing to the link earnest file
– v reveal those changes with informative material
-R directory of all files on a folder recursively change
user: [group] refers to a change in the user group for the group User
eg: chown-R fenix: root *
that the current directory of all files and folders to the root group use of those fenixchgrp [-hR] groupname filename the file is set to change to change the symbolic link-h-R recursively change the id username username revealed the uid, gid, and reveals the history of personal id call ps [-Aw] [aux]: the current running process bash-A list of all History
-w reveals more information
-au reveal detailed information
-aux reveals all, including the history of the use of those other eg: ps auxgrep History reveals the nautilus nautilus pstree:-a revealing history of the tree to reveal the full course of the call and the parameters
-c, if repeated course name, departure lists renice priority [[-p] pid …] [[-g] pgrp …] [[-u] user …]: reassign one or more process priority order
will journey with id 987 and 32 The journey and the journey of a person as a daemon and root priority order number plus 1. eg: renice 1 987-u daemon root-p 32pkill NAME: quick kill process. eg: pkill firefoxskill [signal to send] [options]: the legal decision process
statutory decision process that is, terminal code, the use of those names, the process code, command names
< br />-t terminal code (tty or pty)
-u use those names
-p process ID (pid)
– c command names, eg: those who still use three user1, user2, user3. skill-STOP user1 user2 user3kill [-s signal |-p] [-a] PID: terminate the process called kill-l: back to semaphores
0-normal 1-signalSIGHUP, Hangup. # reboot
2-signalSIGINT, Interrupt # break, ctrl c3-signalSIGQUIT, Quit
4-signalSIGILL, Illegalinstruction 5-signalSIGTRAP, Trace / breakpointtrap

6-signalSIGABRT, Aborted 7-signalSIGEMT, Emulationtrap
8-signalSIGFPE, Arithmeticexception 9-signalSIGKILL, Killed # unconditionally closed
10-signalSIGBUS, Buserror 11-signalSIGSEGV, Segmentationfault
12-signalSIGSYS, Badsystemcall 13-signalSIGPIPE, Brokenpipe
14-signalSIGSTOP, Stopped (signal) 15-signalSIGTERM, Terminated # warm end

16-signalSIGXCPU, CPUtimelimitexceeded 17-signalSIGTTIN, Stopped (ttyinput)
18-signalSIGCONT, Continued # restore, fg, bg19-signalSIGTTOU, Stopped (ttyoutput)
20 – signalSIGTSTP, Stopped (user) # suspend the running, ctrl z 21-signalSIGXFSZ, Filesizelimitexceeded
top called: dynamic process of running up the back to reveal that the current system is running a number of folks husband load average: 0.06, 0.60, 0.48 system load, that is, the balance of the task queue length. Three values ??parting of 1 minute, 5 minutes, 15 minutes ago to the current equilibrium value Cpu (s): 0.3% us user-space cross-borrowing CPU percentage, 1.0% sy cross-borrowing kernel space CPU percentage, 0.0% ni change within the user-space process priority over the course of cross-borrowing CPU percentage, 98.7% id ease CPU percentage, jae connectors 0.0% wa expect the percentage of input and output of the CPU time priority NI nice PR value, negative value indicates higher priority VIRT fictional history of the use of total memory history of use of RES, has not been swapped out of physical memory size, kb SHR shared memory unit, kb units in the course of events S s sleep, r run, t trace or static, z zombie, d% CPU is not interrupted sleep last updated to the current CPU time borrow money for a short time percentage% MEM process of using the percentage of physical memory TIME history of the use of the CPU time total, 1 / 100 second units COMMAND calling line press the f key to decision to reveal the column, press o to change the column to reveal the order, press R key to reverse the current sort of linux like debian release software use discipline called apt: apt-get [-qy] [-c config_file] [options] software …
q in the background environment rigorously enforce
y y approval at the positive response
c followed with a file
options
update, install, remove, purge, clean, dist-upgrade
apt-cache [search project]
search project
search, show,
showpkg rely on the software then lists the properties and functions
dump header and list all software relying on coherent properties of software
pkgnames lists all the system software names of senior software discipline called dpkg [-ilLSC] -i install package-l look at the package is installed-L look at what the package includes file-S / path / to / file look at the system in which package a file is supplied by the-C to see which package did not install the network ended the call type: ifup eth0 open eth0, ifdown eth1 off eth1
ifconfig [inte *** ce] [options], set up the network equipment called
inte *** ce interface name, such as eth0
options, options
up

Posted: January 7th, 2012
at 7:46am by admin

Tagged with


Categories: Uncategorized

Comments: No comments