Search Results

Search found 26176 results on 1048 pages for 'stream socket client'.

Page 2/1048 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C socket programming: calling recv() changes my socket file descriptor?

    - by fourier
    Hey all, I have this strange problem with recv(). I'm programming client/server where client send() a message (a structure to be exact) and server recv() it. I am also working with multiple sockets and select(). while(1) { readset = info->read_set; info->copy_set = info->read_set; timeout.tv_sec = 1; timeout.tv_usec = 0; // 0.5 seconds ready = select(info->max_fd+1, &readset, NULL, NULL, &timeout); if (ready == -1) { printf("S: ERROR: select(): %s\nEXITING...", strerror(errno)); exit(1); } else if (ready == 0) { continue; } else { printf("S: oh finally you have contacted me!\n"); for(i = 0; i < (info->max_fd+1); i++) { if(FD_ISSET(i, &readset)) //this is where problem begins { printf("S: %i is set\n", i); printf("S: we talking about socket %i son\n", i); // i = 4 num_bytes = recv(i, &msg, MAX_MSG_BYTE, 0); printf("S: number of bytes recieved in socket %i is %i\n", i, num_bytes); // prints out i = 0 what?? if (num_bytes == 0) { printf("S: socket has been closed\n"); break; } else if (num_bytes == -1) { printf("S: ERROR recv: %d %s \n", i, strerror(errno)); continue; } else { handle_request(arg, &msg); printf("S: msg says %s\n", msg->_payload); } } // if (FD_ISSET(i, &readset) else printf("S: %i is not set\n", i); } // for (i = 0; i < maxfd+1; i++) to check sockets for msg } // if (ready == -1) info->read_set = info->copy_set; printf("S: copied\n"); } the problem I have is that in read_set, 0~3 aren't set and 4 is. That is fine. But when i call recv(), i suddently becomes 0. Why is that? It doesn't make sense to me why recv() would take an socket file descriptor number and modify to another number. Is that normal? Am I missing something? S: 0 is not set S: 1 is not set S: 2 is not set S: 3 is not set S: 4 is set S: we talking about socket 4 son S: i is strangely or unstrangely 0 S: number of bytes recieved in socket 0 is 40 That's what it prints out.

    Read the article

  • UDP Socket Client in .NET

    - by Betamoo
    I use UDP Sokckts in my client application. Here are some code snippets: SendIP = new IPEndPoint(IPAddress.Parse(IP), port); ReceiveIP = (EndPoint)(new IPEndPoint(IPAddress.Any, 0)); socket = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); socket.Bind(ReceiveIP); And to Receive (while(true)): byte[] data = new byte[BUFFERSIZE]; int receivedDataLength = socket.ReceiveFrom(data, ref ReceiveIP); string s= Encoding.ASCII.GetString(data, 0, receivedDataLength); I am doing an infinite while on the receive, there are other things to be done in the while, even if nothing is received.. I want to check if there are actually available data then receive else do not wait.. (Note the current receive method waits until the server sends a message)

    Read the article

  • Python socket error on UDP data receive. (10054)

    - by Charles
    I currently have a problem using UDP and Python socket module. We have a server and clients. The problem occurs when we send data to a user. It's possible that user may have closed their connection to the server through a client crash, disconnect by ISP, or some other improper method. As such, it is possible to send data to a closed socket. Of course with UDP you can't tell if the data really reached or if it's closed, as it doesn't care (atleast, it doesn't bring up an exception). However, if you send data and it is closed off, you get data back somehow (???), which ends up giving you a socket error on sock.recvfrom. [Errno 10054] An existing connection was forcibly closed by the remote host. Almost seems like an automatic response from the connection. Although this is fine, and can be handled by a try: except: block (even if it lowers performance of the server a little bit). The problem is, I can't tell who this is coming from or what socket is closed. Is there anyway to find out 'who' (ip, socket #) sent this? It would be great as I could instantly just disconnect them and remove them from the data. Any suggestions? Thanks.

    Read the article

  • How to send XML data through socket InputStream

    - by THeK3nger
    Hi, I'm trying to write a client-server application in Java with an XML-based protocol. But I have a great problem! See this part of client code: InputStream incoming = skt.getInputStream(); //I get Stream from Socket. OutputStream out = skt.getOutputStream(); [...] XMLSerializer serializer = new XMLSerializer(); //This create an XML document. tosend = WUTPClientWriter.createMessage100(projectid, cpuclock, cpunumber); serializer.setOutputByteStream(out); serializer.serialize(tosend); At this point server fall in deadlock. It wait for EOF but I can't send it because if I use out.close(); or skt.shutdownOutput(); I close Socket and I must keep alive this connection. I can't send '\0' becouse I get Parse Error in the server. How can I do? Can I "close" output stream without close socket? RESOLVED I've created new class XMLStreamOutput and XMLStreamInput with advanced Stream gesture.

    Read the article

  • Threads are facing deadlock in socket program [migrated]

    - by ankur.trapasiya
    I am developing one program in which a user can download a number of files. Now first I am sending the list of files to the user. So from the list user selects one file at a time and provides path where to store that file. In turn it also gives the server the path of file where does it exist. I am following this approach because I want to give stream like experience without file size limitation. Here is my code.. 1) This is server which gets started each time I start my application public class FileServer extends Thread { private ServerSocket socket = null; public FileServer() { try { socket = new ServerSocket(Utils.tcp_port); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void run() { try { System.out.println("request received"); new FileThread(socket.accept()).start(); } catch (IOException ex) { ex.printStackTrace(); } } } 2) This thread runs for each client separately and sends the requested file to the user 8kb data at a time. public class FileThread extends Thread { private Socket socket; private String filePath; public String getFilePath() { return filePath; } public void setFilePath(String filePath) { this.filePath = filePath; } public FileThread(Socket socket) { this.socket = socket; System.out.println("server thread" + this.socket.isConnected()); //this.filePath = filePath; } @Override public void run() { // TODO Auto-generated method stub try { ObjectInputStream ois=new ObjectInputStream(socket.getInputStream()); try { //************NOTE filePath=(String) ois.readObject(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } File f = new File(this.filePath); byte[] buf = new byte[8192]; InputStream is = new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(is); ObjectOutputStream oos = new ObjectOutputStream( socket.getOutputStream()); int c = 0; while ((c = bis.read(buf, 0, buf.length)) > 0) { oos.write(buf, 0, c); oos.flush(); // buf=new byte[8192]; } oos.close(); //socket.shutdownOutput(); // client.shutdownOutput(); System.out.println("stop"); // client.shutdownOutput(); ois.close(); // Thread.sleep(500); is.close(); bis.close(); socket.close(); } catch (IOException ex) { ex.printStackTrace(); } } } NOTE: here filePath represents the path of the file where it exists on the server. The client who is connecting to the server provides this path. I am managing this through sockets and I am successfully receiving this path. 3) FileReceiverThread is responsible for receiving the data from the server and constructing file from this buffer data. public class FileReceiveThread extends Thread { private String fileStorePath; private String sourceFile; private Socket socket = null; public FileReceiveThread(String ip, int port, String fileStorePath, String sourceFile) { this.fileStorePath = fileStorePath; this.sourceFile = sourceFile; try { socket = new Socket(ip, port); System.out.println("receive file thread " + socket.isConnected()); } catch (IOException ex) { ex.printStackTrace(); } } @Override public void run() { try { ObjectOutputStream oos = new ObjectOutputStream( socket.getOutputStream()); oos.writeObject(sourceFile); oos.flush(); // oos.close(); File f = new File(fileStorePath); OutputStream os = new FileOutputStream(f); BufferedOutputStream bos = new BufferedOutputStream(os); byte[] buf = new byte[8192]; int c = 0; //************ NOTE ObjectInputStream ois = new ObjectInputStream( socket.getInputStream()); while ((c = ois.read(buf, 0, buf.length)) > 0) { // ois.read(buf); bos.write(buf, 0, c); bos.flush(); // buf = new byte[8192]; } ois.close(); oos.close(); // os.close(); bos.close(); socket.close(); //Thread.sleep(500); } catch (IOException ex) { ex.printStackTrace(); } } } NOTE : Now the problem that I am facing is at the first time when the file is requested the outcome of the program is same as my expectation. I am able to transmit any size of file at first time. Now when the second file is requested (e.g. I have sent file a,b,c,d to the user and user has received file a successfully and now he is requesting file b) the program faces deadlock at this situation. It is waiting for socket's input stream. I put breakpoint and tried to debug it but it is not going in FileThread's run method second time. I could not find out the mistake here. Basically I am making a LAN Messenger which works on LAN. I am using SWT as UI framework.

    Read the article

  • python reports socket in use, netstat and others claim its not

    - by captainmish
    We have a strange socket issue with a RHES3 box: Python 2.4.1 (#1, Jul 5 2005, 19:17:11) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-52)] Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> s = socket.socket() >>> s.bind(('localhost',12351)) Traceback (most recent call last): File "<stdin>", line 1, in ? File "<string>", line 1, in bind socket.error: (98, 'Address already in use') This seems normal, lets see what has that socket: # netstat -untap | grep 12351 {no output} # grep 12351 /proc/net/tcp {no output} # lsof | grep 12351 {no output} # fuser -n tcp 12351 {no output, repeating the python test fails again} # nc localhost 12351 {no output} # nmap localhost 12351 {shows port closed} Other high ports work fine (eg 12352 works) Is there something magic about this port? Is there somewhere else I can look? Where does python find out that socket is in use that netstat doesnt know about? Any other way I can find out what/if that socket is?

    Read the article

  • Listening socket

    - by hoodoos
    I got a strange problem, I never actually expirienced this before, here is the code of the server (client is firefox in this case), the way I create it: _Socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ); _Socket.Bind( new IPEndPoint( Settings.IP, Settings.Port ) ); _Socket.Listen( 1000 ); _Socket.Blocking = false; the way i accept connection: while( _IsWorking ) { if( listener.Socket.Poll( -1, SelectMode.SelectRead ) ) { Socket clientSocket = listener.Socket.Accept(); clientSocket.Blocking = false; clientSocket.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true ); } } So I'm expecting it hang on listener.Socket.Poll till new connection comes, but after first one comes it hangs on poll forever. I tried to poll it constantly with smaller delay, let's say 10 microseconds, then it never goes in SelectMode.SelectRead. I guess it maybe somehow related on client's socket reuse? Maybe I don't shutdown client socket propertly and client(firefox) decides to use an old socket? I disconnect client socket this way: Context.Socket.Shutdown( SocketShutdown.Both ); // context is just a wrapper around socket Context.Socket.Close(); What may cause that problem?

    Read the article

  • WCF client and non-wcf client

    - by Lijo
    Hi, Could you please tell what is the difference between a WCF client and a non-WCF client? When I generate proxy of a WCF service using svcutil and put that in client, what is created - wcf client or non-wcf client? When should I use WCF client and non-WCF Client? Thanks Lijo

    Read the article

  • How to use rhythmbox-client on LAN?

    - by Kaustubh P
    A few days ago I had asked this question, and according to one suggestion, used rhythmote. It is a web-interface to change songs on a rhythmbox playing on some PC. However, its not what I had thought of, and I stumbled upon documentation for rhythmbox-client. I tried a few ways of using it, but was unsuccessful. Let me show you a few ways of how I did it. The rhythmbox is running at address 192.168.1.4, lets call it jukebox. Passing the address as a parameter Hoping that I would be able to see and browse through songs on the jukebox rhythmbox-client 192.168.1.4 But, I get this message (rhythmbox-client:8370): Rhythmbox-WARNING **: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. (rhythmbox-client:8370): Rhythmbox-WARNING **: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. SSH ssh -l jukebox 192.168.1.4 rhythmbox-client --print-playing Which spat this at me: (rhythmbox-client:9389): Rhythmbox-WARNING **: /bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed. rhythmbox-client as root gksudo rhythmbox-client 192.168.1.4 A rhythmbox client comes up, but with no music shown in the library. I am guessing this is running on my own computer. Can anyon tell me how rhythmbox-client is to be run, and is it even correct of me to think that I can get a rhythmbox window showing the songs on the jukebox? PS: There were a few other solutions mentioned, but I want to evaluate each and every one of them. Thanks.

    Read the article

  • why client can not receive message from server (java) [migrated]

    - by user1745931
    I have just started learning java. I modified the client side code for a server/client communication program, by creating two threads for the client side, main thread for receiving user's input, and inputThread for receiving server's response. I am sure that server has sent the response to client, however, no response message is obtain at client. Here is my code. Can anyone help me to figure it out? Thanks package clientnio; import java.net.*; import java.nio.*; import java.io.*; import java.nio.channels.*; import java.util.Scanner; public class ClientNIO { public static int bufferLen = 50; public static SocketChannel client; public static ByteBuffer writeBuffer; public static ByteBuffer readBuffer; public static void main(String[] args) { writeBuffer = ByteBuffer.allocate(bufferLen); readBuffer = ByteBuffer.allocate(bufferLen); try { SocketAddress address = new InetSocketAddress("localhost",5505); System.out.println("Local address: "+ address); client=SocketChannel.open(address); client.configureBlocking(false); //readBuffer.flip(); new inputThread(readBuffer); /* String a="asdasdasdasddffasfas"; writeBuffer.put(a.getBytes()); writeBuffer.clear(); int d=client.write(writeBuffer); writeBuffer.flip(); */ while (true) { InputStream inStream = System.in; Scanner scan = new Scanner(inStream); if (scan.hasNext()==true) { String inputLine = scan.nextLine(); writeBuffer.put(inputLine.getBytes()); //writeBuffer.clear(); System.out.println(writeBuffer.remaining()); client.write(writeBuffer); System.out.println("Sending data: "+new String(writeBuffer.array())); writeBuffer.flip(); Thread.sleep(300); } } } catch(Exception e) { System.out.println(e); } } } class inputThread extends Thread { private ByteBuffer readBuffer; public inputThread(ByteBuffer readBuffer1) { System.out.println("Receiving thread starts."); this.readBuffer = readBuffer1; start(); } @Override public void run() { try { while (true) { readBuffer.flip(); int i=ClientNIO.client.read(readBuffer); if(i>0) { byte[] b=readBuffer.array(); System.out.println("Receiving data: "+new String(b)); //client.close(); //System.out.println("Connection closed."); //break; } Thread.sleep(100); } } catch (Exception e) { System.out.println(e); } } }

    Read the article

  • Reading / Writing from a Unix Socket in Ruby

    - by Olly
    I'm trying to connect, read and write from a UNIX socket in Ruby. It is a stats socket used by haproxy. My code is the following: require 'socket' socket = UNIXSocket.new("/tmp/haproxy.stats.socket") # First attempt: works socket.puts("show stat") while(line = socket.gets) do puts line end # Second attemp: fails socket.puts("show stat") while(line = socket.gets) do puts line end It succeeds the first time, but on the second attempt fails. I'm not sure why. # pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,tracked,type,rate,rate_lim,rate_max,check_status,check_code,check_duration,hrsp_1xx,hrsp_2xx,hrsp_3xx,hrsp_4xx,hrsp_5xx,hrsp_other,hanafail,req_rate,req_rate_max,req_tot,cli_abrt,srv_abrt, stats,FRONTEND,,,0,0,2000,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,1,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,, stats,BACKEND,0,0,0,0,2000,0,0,0,0,0,,0,0,0,0,UP,0,0,0,,0,22,0,,1,1,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0, legacy_socket,FRONTEND,,,0,0,1000,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,2,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,, all,FRONTEND,,,0,0,10000,0,0,0,0,0,0,,,,,OPEN,,,,,,,,,1,3,0,,,,0,0,0,0,,,,0,0,0,0,0,0,,0,0,0,,, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,1,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,2,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,3,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,4,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,5,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,6,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,22,22,,1,4,7,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,21,21,,1,4,8,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,21,21,,1,4,9,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,socket,0,0,0,0,200,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,21,21,,1,4,10,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, socket_backend,BACKEND,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,DOWN,0,0,0,,1,21,21,,1,4,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0, api_backend,api,0,0,0,0,200,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,22,0,,1,5,1,,0,,2,0,,0,L4OK,,0,0,0,0,0,0,0,0,,,,0,0, api_backend,api,0,0,0,0,1,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,22,0,,1,5,2,,0,,2,0,,0,L4OK,,0,0,0,0,0,0,0,0,,,,0,0, api_backend,api,0,0,0,0,1,0,0,0,,0,,0,0,0,0,DOWN,1,1,0,0,1,21,21,,1,5,3,,0,,2,0,,0,L4CON,,0,0,0,0,0,0,0,0,,,,0,0, api_backend,BACKEND,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,UP,2,2,0,,0,22,0,,1,5,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0, www_backend,ruby-www,0,0,0,0,10000,0,0,0,,0,,0,0,0,0,UP,1,1,0,0,0,22,0,,1,6,1,,0,,2,0,,0,L4OK,,0,0,0,0,0,0,0,0,,,,0,0, www_backend,BACKEND,0,0,0,0,0,0,0,0,0,0,,0,0,0,0,UP,1,1,0,,0,22,0,,1,6,0,,0,,1,0,,0,,,,0,0,0,0,0,0,,,,,0,0, /Users/Olly/Desktop/haproxy_stats.rb:14:in `write': Broken pipe (Errno::EPIPE) from /Users/Olly/Desktop/haproxy_stats.rb:14:in `puts' from /Users/Olly/Desktop/haproxy_stats.rb:14 What is the problem? Is there a good reference to using UNIX sockets and Ruby?

    Read the article

  • Python: unix socket -> broken pipe

    - by Heinrich Schmetterling
    I'm trying to get Python socket working as an alternative to calling the command line socat. This socat command works fine: echo 'cmd' | sudo socat stdio <path-to-socket> but when I run this python code, I get an error: >>> import socket >>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) >>> s.connect(<path-to-socket>) >>> s.send('cmd') Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.error: (32, 'Broken pipe') Any ideas what the issue is? Thanks.

    Read the article

  • Client-Server connection response timeout issues

    - by Srikar
    User creates a folder in client and in the client-side code I hit an API to the server to make this persistent for that user. But in some cases, my server is so busy that the request timesout. The server has executed my request but timedout before sending a response back to client. The timeout set is 10 seconds in client. At this point the client thinks that server has not executed its request (of creating a folder) and ends up sending it again. Now I have 2 folders on the server but the user has created only 1 folder in the client. How to prevent this? One of the ways to solve this is to use a unique ID with each new request. So the ID acts as a distinguisher between old and new requests from client. But this leads to storing these IDs on my server and do a lookup for each API call which I want to avoid. Other way is to increase the timeout duration. But I dont want to change this from 10 seconds. Something tells me that there are better solutions. I have posted this question in stackoverflow but I think its better suited here. UPDATE: I will make my problem even more explicit. The client is a webbrowser and the server is running nginx+django+mysql (standard stack). The user creates a folder in webbrowser. As a result I need to hit a server API. The API call responds back, thereby client knows API call was success. This is normal scenario. Sometimes though, server successfully completes the API request but the client-side (webbrowser) connection timesout before server can respond back. The client has no clue at this point. The user thinks the request was a fail & clicks again. This time it was a success but when the UI refreshes he sees 2 folders. I want to remedy this situation.

    Read the article

  • Sniff UNIX domain socket

    - by gonvaled
    I know that some process is writing to a certain unix domain socket (/var/run/asterisk/asterisk.ctl), but I do not known the pid of the sender. How can I find out who is writing to the socket? I have tried with: sudo lsof /var/run/asterisk/asterisk.ctl but it just list the owner of the socket. I would like to know who is writing / reading to this socket, and I would also like to sniff the data. Is this possible?

    Read the article

  • ADF Mobile Client is now Generally Available!

    - by joe.huang
    ADF Mobile Client is now generally available!  The press release went out this morning, and the ADF Mobile Client extensions can now be downloaded in the JDeveloper Update Center.  There is also a new Oracle Mobile Computing Strategy White Paper and Data Sheet available, for a high level overview of ADF Mobile. To get started with ADF Mobile Client development, please leverage the following resources: Oracle Technology Network ADF Mobile Landing Page: Review this page for all available resources for ADF Mobile development. Getting Start with ADF Mobile Client Demo: Short demo of the end-to-end development process. Tutorial for Mobile Application Development using ADF Mobile Client ADF Mobile Client Developer Guide ADF Mobile Client Samples: available in the JDeveloper Extension itself.  Located in <JDeveloper Install Location>/jdev/extensions/oracle.adfnmc.core/Samples directory.  Blogs will follow, describing each of the sample applications in more detail. Oracle Database Mobile Server: If database synchronization is needed, please follow this link to download/install Mobile Server. Leverage JDeveloper Forum for any ADF Mobile related questions. You will need the latest (11g Patch Set 3, or 11.1.1.4.0) version of JDeveloper to use this extension.  To download the ADF Mobile Client extension in JDeveloper, you would go to Help Menu, select “Check For Update”, and look for ADF Mobile Client extension in the Official Oracle Extensions and Updates center.  You can also directly download the extension from Oracle Technology Network. Check it out!  For any issues with accessing any of the links above, please contact me directly. Thanks, Joe Huang ([email protected])

    Read the article

  • Socket read() hangs for a while when there is no data to read.

    - by janesconference
    Hi' I'm writing a simple http port forwarder. I read data from port 80, and pass the data to my lighttpd server, on port 8080. As long as I write() data on the socket on port 8080 (forwarding the request) there's no problem, but when I read() data from that socket (forwarding the response), the last read() hangs a lot (about 1 or 2 seconds) before realizing there's no more data and returning 0. I tried to set the socket to non-blocking, but this doesn't work, as sometimes it returns EWOULDBLOCKING even if there's some data left (lighttpd + cgi can be quite slow). I tried to set a timeout with select(), but, as above, a slow cgi could timeout the socket when there's actually some data to transmit. How would you do?

    Read the article

  • Adobe Air turn based multiplayer Game, sockets vs http bandwidth

    - by Arin Aivazian
    I am developing an Adobe Air multiplayer game for iPad. It is turn based and not realtime. It is like checkers game. I want to use a client server model. I have found 2 options to connect to server so far: socket connection and http requests My question is: Is the bandwidth requirement for socket connection vs http requests different? I need the game to work with very low speed internet connections

    Read the article

  • To refund or not to refund this client?

    - by Mahalia Samuels
    I'd really appreciate your advice on an ongoing project. I presented my client with a proposal and design samples which he approved, and he paid in full instead of the 50% upfront deposit as I'd given him a generous discount. He was then slow in furnishing me with some of the content, but once we did, he expected the website to be finished immediately which was not possible. Because he needed it done urgently, we agreed to try to get it done about 10 working days after the content was provided, but the developer who was helping me let me down. The next week, I completed the website myself and uploaded it to the server on a Friday afternoon. He then calls and texts me on following Sunday while I'm at church to say it's not online (there was probably a problem with his browser). The next morning, I received an email from him demanding a full refund within two days because he couldn't see the website (even though it was live, and I tested it on multiple browsers, a different computer and my phone), and he called me shouting at me because he couldn't access it. Finally when he was able to access it, he was unhappy with a certain detail regarding the slideshow which I began fixing and which was done the next day. He then referred me to another website and said he wanted it to look similar but not identical to it in terms of the layout. He also now wanted to add more features which were not in the original design. I got a designer to work on a new design which I sent to him for review, which if approved would be completed by 15 October, and he approved it last Thursday. He then called me yesterday to say that he wanted to change the design - he only approved it out of impatience. He now wants the website to be more similar to the other website he referred me to and he wants it done before the 15th! Then, he says to me that other people have done websites for him in three days - website's he's complained to me about for lacking dimension because they were just premium themes, whereas we'd designed and coded from scratch. I'm thinking of finishing the website but refunding him in full (or at least the refundable 50%) less domain registration and other non-refundable amounts, just to avoid further escalation of this matter and having him call me next week and say he wants to change it again. These are the applicable terms and conditions as laid out in the agreement: Total amount due for this project is Amount A. Client shall pay Consultant a deposit of Amount B (50% of total amount due for project) in advance before any work commences on the Project. The balance is due within 7 working days of completion of project. Deposit is non-refundable. Should client opt to host elsewhere, applicable transferral fee of Amount C will apply. Estimated project completion time frame is 14 to 30 days from the date Client furnishes Consultant with Brief and all other required media and data, provided that Client has made payment to secure the project. Consultant will make every effort to meet agreed upon due dates. The Client should be aware that failure to submit required information or materials, or last minute changes and excessive changes may cause subsequent delays. Client delays could result in significant delays in delivery of finished work. Major changes in client input or direction or brief will be charged at normal rates. Any work the Client wishes Consultant to create, which is not specified in the attached Proposal will be considered an additional service. Client agrees to pay Consultant for any additional expenses or additional services not included in the attached quotation and proposal if requested by the Client. Web design credit in the name of the Consultant, and link to Consultant’s website shall be placed on the footer of the final Website. Either party may terminate this Agreement by giving 7 days written notice to the other of such termination. In the event that Work is postponed or terminated at the request of the Client, Consultant shall have the right to bill pro rata at full rates for work completed through the date of that request, while reserving all rights under this Agreement. If additional payment is due, this shall be payable within seven days of the Client's written notification to stop work. In the event of termination, the Client shall also pay any expenses incurred by Consultant and the Consultant shall own all rights to the Work. Advice please?

    Read the article

  • Make a socket as a user but make it readable and writable by another

    - by user1598585
    I have a software that is run under user A, this software creates a socket in /sockets and the socket should be readable and writable by user B. I have tried setting the directory to have ownership A:A or A:B but when user A creates the socket, it ends up with uid A and gid A. Using ACLs has not helped so far, the default mask is preventing the rights to be effective. rw permisions for B will always turn into jusr r. If what I make is not a socket it will work fine. How can I best accomplish this task? (It is for a web-server where the web-application makes the socket and the web-server software forwards requests to it)

    Read the article

  • Make a socket as an user but make it readable and writable by another

    - by user1598585
    I have a software that is run under user A, this software creates a socket in /sockets and the socket should be readable and writable by user B. I have tried setting the directory to have ownership A:A or A:B but when user A creates the socket, it ends up with uid A and gid A. Using ACLs has not helped so far, the default mask is preventing the rights to be effective. rw permisions for B will always turn into jusr r. If what I make is not a socket it will work fine. How can I best accomplish this task? (It is for a web-server where the web-application makes the socket and the web-server software forwards requests to it)

    Read the article

  • How to handle server-client requests

    - by Layne
    Currently I'm working on a Server-Client system which will be the backbone of my application. I have to find the best way to send requests and handle them on the server-side. The server-side should be able to handle requests like this one: getPortfolio -i 2 -d all In an old project I decided to send such a request as string and the server application had to look up the first part of the string ("getPortfolio"). Afterwards the server application had to find the correct method in a map which linked the methods with the the first part of the string ("getPortfolio"). The second part ("-i 2 -d all") got passed as parameter and the method itself had to handle this string/parameter. I doubt that this is the best solution in order to handle many different requests. Rgds Layne

    Read the article

  • Java 8 Stream, getting head and tail

    - by lyomi
    Java 8 introduced a Stream class that resembles Scala's Stream, a powerful lazy construct using which it is possible to do something like this very concisely: def from(n: Int): Stream[Int] = n #:: from(n+1) def sieve(s: Stream[Int]): Stream[Int] = { s.head #:: sieve(s.tail filter (_ % s.head != 0)) } val primes = sieve(from(2)) primes takeWhile(_ < 1000) print // prints all primes less than 1000 I wondered if it is possible to do this in Java 8, so I wrote something like this: IntStream from(int n) { return IntStream.iterate(n, m -> m + 1); } IntStream sieve(IntStream s) { int head = s.findFirst().getAsInt(); return IntStream.concat(IntStream.of(head), sieve(s.skip(1).filter(n -> n % head != 0))); } IntStream primes = sieve(from(2)); PrimitiveIterator.OfInt it = primes.iterator(); for (int prime = it.nextInt(); prime < 1000; prime = it.nextInt()) { System.out.println(prime); } Fairly simple, but it produces java.lang.IllegalStateException: stream has already been operated upon or closed because both findFirst() and skip() is a terminal operation on Stream which can be done only once. I don't really have to use up the stream twice since all I need is the first number in the stream and the rest as another stream, i.e. equivalent of Scala's Stream.head and Stream.tail. Is there a method in Java 8 Stream that I can achieve this? Thanks.

    Read the article

  • Design pattern for client/server sessions?

    - by nonot1
    Are there any common patterns or general guidance I can learn from for how to design a client/server system where the both the client and server must maintain some kind per-client session state? I've found any number of libraries that can help with some of the plumbing, but it's the overall design I'm wondering about. Open issues in my mind: How to structure the client/server communication so that bidirectional synchronous and asynchronous requests are possible? The server side needs to spawn a couple of per-connected-client session-long helper process. How to manage that? How to manage the mapping from a given client (and any of it's requests) to server state and helper process instances in the face of multiple clients and intermittent network connectivity. Most communication can be simple blocking request/reply, but some will be long running processing tasks that the client will want to keep tabs on. To the extent that it matters, the platform is Linux/C/C++. Not web based. Just an existing thick-client software app being modified to talk to backend servers for some tasks.

    Read the article

  • I am unable to run a client/server program in php

    - by sibi
    This is the program I am trying to run: $host = "127.0.0.1"; $port = 25003; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); // bind socket to port $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n"); // start listening for connections $result = socket_listen($socket, 3) or die("Could not set up socket listener\n"); // accept incoming connections // spawn another socket to handle communication $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); // read client input $input = socket_read($spawn, 1024) or die("Could not read input\n"); // clean up input string $input = trim($input); echo "Client Message : ".$input; // reverse client input and send back $output = strrev($input) . "\n"; socket_write($spawn, $output, strlen ($output)) or die("Could not write output\n"); // close sockets socket_close($spawn); socket_close($socket); I enabled the PHP_socket option in WAMP but still I keep getting errors like unable to bind. Can someone please help me out?

    Read the article

  • TcpListener Socket still active after program exits.

    - by lnical
    I'm trying to stop a TCP Listener as my program is exiting. I do not care about any data that is currently active on the socket or any of the active client sockets. The socket clean up code is essentially: try { myServer.Server.Shutdown(SocketShutdown.Both) } catch (Exception ex) { LogException(ex) } myServer.Server.Close(0) myServer.Stop() myServer is a TCPListener On some occasions, Shutdown will thrown an exception System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied at System.Net.Sockets.Socket.Shutdown(SocketShutdown how) When this happens, the socket is never released. Even after the application exits netstat shows the socket is still in the listening state. I have not been able to create definitive reproduction scenerio, it happens at seemingly random times. Client Sockets are cleaned up independently. Do you have any suggestions to help me make this socket die?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >