Sockets IPv6 socket creation

I am implementing dual stack mode to support IPv4 and IPv6. If I am creating a IPv6 socket and listening on it, will it accept the connection from IPv4 socket also ??

Sockets Runtime addeventlistener slowing down the application display in Lua using Corona

From my code below, how can I make the Runtime listener running without interrupting the display part of my app? Currently the display is slowing down when I use the Runtime listener. FYI I am new to Lua/Corona and also new here in stackoverflow. function scene:createScene( event ) group2 = scrollView.new{ top=topBoundary, bottom=bottomBoundary } myImage = display.newImage("imgbg1.png") myImage.isVisible = true group2:insert(myImage) local yval = 120

Sockets Intermittent Socket Close Warning Resulted in Internal Error

I am getting intermittent socket warning in weblogic server and because of that internal error in web server. The warning message is BEA-000449 which says socket has been closed as no data read from the socket within the specified timeout of 5 sec.I am able to change the time and i can see that it is taking effect. In the error log I can see the following error: Internal Error: proxy error reading status line In the access log I see 502 response codes. I am using: Weblogic server version

Sockets Two RMIRegistry.exe on the same port?

I'm working on a Windows 7 (Professional, 64bit) system and I've seen the current situation, can someone highlight me and explain how's possible? I have installed both Java 6 (JRE only) and Java 7 (JDK), both 64 bits. From command prompt I run rmiregistry.exe (default port 1099) from jre6/bin directory. While that one is running, from another command prompt I try to run it again. It gives me back an exception saying that the port is already bound. Same, with rmiregistry.exe from jdk7/bin direc

Sockets I'd like to read FTP commands

I have written program reading a simple text from clients. The program works well when telnet sends messages, but does not when ftp sends messages. Also, the program misunderstands(?) socket is connected well. (See figure.) In fact, ftp client was trying to connect my server and As time goes by, ftp client fali to connect. I'd like to read ftp message using my server program. What should I do?? Server program - #include <pthread.h> #include <sys/types.h> #include <sys/socket.h&g

Sockets Does a socket remain open even if one sides ip address changes?

If I open a socket between two computers on the WAN, while at least one of them has a dynamic ip-address, and this address changes even though the socket hasn't been explicitly closed : Do have a warranty that this socket will remain open at least until my program really asks to close it? Regards

Sockets what is "T!" represent in socket connection?

i have open java socket for read serial data on localhost, but the when i try more times to read data then i get just two bytes which are T!. i don't know what this two characters represent ?? and what the cause to receive these characters ? I think they are used as Termination or something for connection !!! i try to search for it on google but it give me T connection or terminal.

Sockets Server Socket only print after client socket close

I am implementing a java multi-threaded server. Whatever the client write to the socket stream does not get printed out on the server side. Data is only get printed after I terminate the client thread. What is the problem? Here is my client code to send data: BufferWriter writer = new BufferedWriter( new OutputStreamWriter( socket.getOutputStream() , "UTF-8" ) ); writer.write(curr.substring(3)); writer.flush(); Code on the server: public class ThreadedEchoSe

Sockets Are UDP messages atomic?

If I send some sequence of bytes on a UDP socket (ie, in a single send call), is it possible that the receiving socket will receive only part of the transmitted message (ignoring the case of too small a buffer). Or will the byte sequence be delivered in its entirety or not at all, but never partially or in multiple groups?

Sockets Dynamic buffer size in socket communication - good or bad idea?

is it a good or a bad idea to use dynamic buffer sizes in socket communication? for example: i have a message format [2 bytes: length of the following message][message] So the buffer size will be message.length+2. On the receiver side I can catch the first two bytes and then I know how many more i will have to to catch. Is this a good or a bad idea - and WHY?

Sockets Servicestack redis blocking on hash write without exceptions on socket read

While I was debugging my code using ServiceStack redis components - I noticed a bug that was causing my thread to stop responding halting in a io blocked mode. The code I use is to store a value on a servicestack hash as in the code below. Here the default factory is a pooled redis client manager with send and receive thread counts of 20: using (IRedisClient client = defaultFactory.GetClient()) { client.Hashes[cacheName][key] = SerializationHelper.Serialize(value, ST.Binary); } From my

Sockets Is UDP packet payload size fixed?

How do I find out the current UDP packet payload size for a udp socket? Or is there any way to set it manually? I could not find any socket options related to that.

Sockets Increased MTU but still can't send large UDP packets

a little info on what i'm trying to achieve here first. I'm using a Texas Instrument board EVM6678LE, and what i am trying to do is to increase the UDP transfer rate between the board and my PC. I've increased the MTU on my PC through netsh>interface>ipv4 to 15,000. But when i ping the board from my PC i am only able to ping up to "ping 192.168.2.100 -l 10194", if i ping with 195bytes onwards i'll receive a request timeout. Is this a limitation of my PC or something? Does anyone have any idea

Sockets Erlang TCP Server - Hybrid Socket Model

I am attempting to implement a hybrid (active/passive) socket model TCP server in Erlang: %%%------------------------------------------------------------------- %%% @author mylesmcdonnell %%% @copyright (C) 2015, <COMPANY> %%% @doc %%% %%% @end %%% Created : 04. Feb 2015 14:01 %%%------------------------------------------------------------------- -module(mmkvstore_srv). -author("mylesmcdonnell"). %% API -export([start/1]). start(Port) -> {ok, Listen} = gen_tcp:listen(Port, [binary,

Sockets send message from backend to front on Symfony2 ClankBundle

I'm trying to achieve the following: when the server doing X I want to send a message to user Y. as I can see in ClankBundle's documentation I can achieve that in two ways: make a call from the user side on js. to make a loop that checks if X happened every Z seconds. both of them not really effective as I don't want to check my db every Z seconds I know when X happens and I want to send the message when it happens, I mean.. Symfony2 is events based I'm pretty sure I'm missing something

Sockets How to stop a blocking call of WSAPoll

I have a case to handle. There is one thread calling WSAPoll() to receive data from TCP connection. The code looks like this: int result = WSAPoll(fdSocket, 1, timeout); if (result == 0) { // time out } else if (result == -1) { // socket error } If I set timeout to be a negative number, the thread will wait indefinitely. However, I want to make this function return a value, such as 0, directly to this thread if I call a function StopWait() from another thread. So what can I do to mak

Sockets Serialization of struct in C using tpl

I am trying to send a struct of 3 floats over a tcp/udp connection. I am using tpl The client and server codes are modified from what i found on this site However i get an error, when i unpack the struct. "not a valid tpl file" It would be nice to later send a struct containing int, floats and char(no pointers). This is the client side code #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netin

Sockets Erlang Udp server dropping lots of packets

I've been testing various languages/methods for running a udp server to see which is going to be the most performant. So far I've tested .NET, NodeJs and then Erlang. I'm seeing a problem with this code snip dropping over 50% of the packets I'm sending, whereas node and .net were ~ 4%. The scenario is I'm sending 1000 20 byte messages as quickly as possible and printing an incrementing number out to the screen. Erlang is only getting ~400 of these. Could you suggest anything I could do to improv

Does whatsapp store password?? Or are their Sockets always open?

I am trying to figure out how to auto-reconnect a ejabberd socket connection. Like whatsapp, Facebookmessenger etc For example, when the app is closed, and i receive a push notification to wake the app up and that calls to connect the connection, or if i put the app to the background for an hour, and the connection has been idle too long and get disconnected,then i put the app back to the foreground. I can only think of 2 ways to automatically connect to the ejabberd server. 1.) To have the

Sockets How to connect client and server with socket?

How do I actually run this client/server project on ActionScript 3? I'm using flashbuilder. I'm not sure if I'm even doing the right thing, i made a new as mobile project and put in the code for my client which is this: public class client extends Sprite { private var socket:Socket; private var IP:String = "127.0.0.1"; public function client() { super(); socket = new Socket(); socket.addEventListener(Event.CONNECT, onConnected); socket.connect(I

Sockets Ocaml comparison not working

I am trying to write a simple server program in Ocaml that communicates with other processes via a socket. I currently have a problem that the strings the server reads (with input_line ic) do not seem to compare with other strings properly. For example, I run the server program and use telnet to connect to it, if I send "end" as a line, the server program trys to match with "end", but this doesn't work as expected. The function that handles communication is service (below), w

Sockets gcloud compute: configure firewall for external traffic

I am attempting to configure my google cloud instance to allow external traffic so I can set up a web socket; however despite adding a rule for all external TCP/IP traffic, I can't access it. My rules are: gcloud compute firewall-rules list NAME NETWORK SRC_RANGES RULES SRC_TAGS TARGET_TAGS default-allow-ssh default 0.0.0.0/0 tcp:22 external-traffic default 0.0.0.0/0 tcp,udp gcloud compute instances list NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL

Sockets How to find the right sending speed with UDP?

I want to transfer a large number of messages. The messages do not need to be reliable. UDP comes to mind as a protocol choice. Latency is important as well. I do not want to suffer from TCP head-of-line blocking. I'm concerned I might overload the network when I just start sending messages at maximum speed (e.g. while (messagesRemaining != 0) Send(...);). If I send more than some middle-box can relay then, I think, large numbers of messages might be dropped. Some messages being dropped is fin

Sockets Difference between port number and socket

I started reading UNIX network programming by W. Richard Stevens and I am very confused between a port and a socket . when I read on internet it said that socket is an endpoint for a connection and for port number it was written that , IP address and port no form a unique pair . So now my question is that : (1) What is the difference between these two ? (2)How are sockets and ports internally manipulated. Are sockets a file ? (3) How is data sent when we send it using an application ? (4) If s

Sockets Web page only displaying after server stopped

I am writing a home-made web server in Erlang for learning purposes. The current implementation can parse a HTTP GET request and respond accordingly. The problem is that my test HTML file does not show in the web browser until I shut down the server process. I see the message being sent by prints in the console, but the web browser keeps loading until the server is stopped. The same instant the server is stopped the page is shown. Why is this? listener(Listen) -> case gen_tcp:accept(Listen

Sockets is http based on socket?

every connection to web server need a open port(default 80), so is it correct by regarding "http is based on socket" or can I understand by this "TCP is a protocol, Socket implemented TCP, HTTP is based on TCP, so HTTP is based on Socket"?

Sockets Angular 2 Passing object between routes

Trying to find the answer on how to pass a common object between routes. I have a service which store socket.io I need to have access to that socket service across my whole site so I can listen for emits. I have a route.ts file and I am not sure how to initialise a socket service in the root then pass it to the route when needed. I have read the docs and I am trying to use data like below in my route.ts file: const routes: RouterConfig = [ { path: '', component: AppComponent }, { p

Sockets Using memset function in UDP socket

I have a UDP socket which my client sends an array of integers to the server and the server receives it and store it as a variables. This is happening in an infinite loop. I didn't use any memset function for the buffering in the server side. I checked the results on the sever side and everything is being received correctly. I was wondering if its necessary to use memset at each iteration where I have the recvfrom() function... Servercode: #define BUFSIZE 10 #define SERVERPORT "9090

Sockets RabbitMq refuses connection when run in docker

My docker-compose file looks like this: version: '2' services: explore: image: explore build: context: ./Explore dockerfile: VsDockerfile environment: - "ElasticUrl=http://localhost:9200" - "RabbitMq/Host=localhost" - "RabbitMq/Username=guest" - "RabbitMq/Password=guest" networks: - localnet elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3 container_name: elasticsearch environment: - "ES_J

Sockets Understanding Stun working

I went through the Programming P2P application SO post. but I think I'm still unclear as to how the STUN work under the hood. So, I would like to post my understanding and hope to get them corrected. as per the example assuming that machine (A) IP is 192.168.1.2 running on (TCP client request on STUN server) 4900(TCP client request STUN server over TCP running at 4900) and Stun server returned the Public IP of the Nat device i.e 128.11.12.13 8888 Now I want the Machine B(assuming now B know

Sockets Is there a best practice regarding a payload for socket.io acknowledgements?

I'm working on the serverside on my first socket project. The team chose socket.io. It provides functionality to fire an acknowledgement/callback back to the socket that is talking to it. socket.on('anEvent', (payload, callback) => { doSomethingWith(payload); callback(true); }); I like consistency, so I want to send back consistently shaped objects. For instance: socket.on('anEvent', (payload, callback) => { const responseData = doSomethingWith(payload); callback({

Sockets Netty wss socket client drops connection

Trying to setup basic wss client. Channel is activated, but then immediately disconnected without any exception. Client: class WebSocketClient(val uri: String) { lateinit var ch: Channel fun connect() { val bootstrap = Bootstrap() val uri: URI = URI.create(uri) val handler = WebSocketClientHandler(WebSocketClientHandshakerFactory.newHandshaker(uri, WebSocketVersion.V13, null, false, HttpHeaders.EMPTY_HEADERS, 1280000)) bootstrap.group(NioEventLoopGrou

Sockets Graylog - Failed to write to socket: fwrite(): send of 136 bytes failed with errno=111 Connection refused (8)

I am getting this error when log alert with Gelf logger. RuntimeException Failed to write to socket: fwrite(): send of 136 bytes failed with errno=111 Connection refused (8) Code $transport = new UdpTransport("127.0.0.1", 6379, UdpTransport::CHUNK_SIZE_LAN); $publisher = new Publisher(); $publisher->addTransport($transport); $message = new \Gelf\Message(); $message->setShortMessage("Foobar!") ->setLevel(\Psr\Log\LogLevel::ALERT) ->setFullMessage("There was a fo

Sockets in Lisp

I'm trying to communicate from a Lisp script to another program by using TCP/IP sockets (with sbcl and the usocket library in a Linux system). Through some online sources I have managed to put together the following simple code: (require 'asdf) (require 'usocket) (defun start-client (message) "Connects to server." (usocket:with-client-socket (socket stream "0.0.0.0" 30000) (format stream message) (force-output stream))) (start-client "Hello!~%") This code lets me send a message,

Sockets Update TestStand Socket Test status (Execution Annunciator) while test is running?

I am looking for a way to update the test socket test status (the color: Green, Yellow, Red etc) indicator while the test is running. What I am experiencing is that the red color would appear only at the end of the entire test sequence if any of the test steps fail. If any of the tests in any of the subsequences fail, I can see Red appear on the right side in status indicator for any particular steps however, I would like to know how to have the status of the Execution Annunciator updated during

Sockets SSLWantReadError when using async sock_recv with an SSL connection

I'm implementing a producer-consumer program in a server implementation using sockets and asyncio. The problem is the async function sock_recv() does not seem to be working properly when used with a socket wrapped in an ssl connection. Following is the working code. Server side import asyncio import random import socket import ssl SERVER_ADDRESS = (HOST, PORT) = "127.0.0.1", 8881 async def producer(queue, client_connection, event_loop): while True: print("Waiting for sock_recv")

Sockets How to configure UDP endpoints when client an server are running on different machines connected over P2P connection

I am able communicate UDP packets between a Client and Server running on localhost basically using the below code. #include <boost/asio.hpp> #include <boost/array.hpp> #include <boost/bind.hpp> #include <thread> #include <iostream> #define IPADDRESS "127.0.0.1" #define UDP_PORT 13251 using boost::asio::ip::udp; using boost::asio::ip::address; void Sender(std::string in) { boost::asio::io_service io_service; udp::socket socket(io_service); udp::endpoi

Sockets It is possible to implement it's own TCP/UDP-like protocol?

There is the IP - Internet Protocol. It allows us to address some computer in global network - Internet. There is also a port - endpoint destination on that addressed computer. Someone can establish such an endpoint through socket - a so-named handful of operating system calls (API) and combination of IP address and port. It can be done using one of two "transport" protocols - either TCP or UDP. TCP provides a guarantee of delivery, UDP doesn't. In both cases someone given with a stream of byte

Sockets Record data flow over socket

I have a client-server model, exchanging data using usual socket connection (INET, TCP). Is there a way to record the message flow over the connection? I was hoping to build a realtime visualization for the data flow at the application level. Having a way to do this without requiring to sudo would be helpful. Please let me know if you need more details to provide an answer.

Sockets Is there a way to wait for a listening socket on win32?

I have a server and client program on the same machine. The server is part of an application- it can start and stop arbitrarily. When the server is up, I want the client to connect to the server's listening socket. There are win32 functions to wait on file system changes (ReadDirectoryChangesW) and registry changes (RegNotifyChangeKeyValue)- is there anything similar for network changes? I'd rather not have the client constantly polling.

Sockets Python3 Catch errors when from self.connect(('badhost',6667))

Looks like asyncio is the module to use. I'll leave this question up anyway, because it doesn't look like there is a way to catch specific errors with asynchat. class mysocket(asynchat.async_chat): terminator = b'\n' def __init__(self,sock=None): asynchat.async_chat.__init__(self,sock) self.create_socket() # Try always succeeds with self.connect try: self.connect(('badhost',6667)) print('command always successful') except:

Sockets why many libraries does not detect dead TCP connections?

TCP has a keep-alive mechanism to detect dead connections, but it surprised me that this option is turned off by default and many libraries/tools do not utilize this feature. If I am understanding correctly, a TCP connection blocked in a recv call won't be able to detect if a connection has been actually aborted by peer if all the FIN/RST packets from peer have been lost. A timeout parameter on client side may alleviate the issue but many libraries does not have a option to set timeout eithe

Sockets Cannot do network programming in XCode anymore

Until recently, the following code worked perfectly in my project. But since a few days ago, it no longer works. I can replace the NSLog statements with printf statements, replace the other Obj-C style statements and compile with g++ in terminal it works just fine. It should just connect to a very primitive server on a Raspberry Pi, send a single character 'R', and read back a 2-Byte integer. When I compiled or ran it in XCode months ago it worked. When I compile now in terminal with g++ it

Sockets next.js socket.io useeffect not updating on socket message

i'm facing an issue with my socket client on next.js . i have created a context for providing my socket instance for all components in the application , the problem is that when i want to use the socket context on my component i am using the useeffect hook be called once the socket is changed and i will handle on message call ( like any tutorial i have seen on the web ) but with new message on the socket the useeffect is not called at all . for those who may think this is context issue i should

  1    2   3   4   5   6  ... 下一页 最后一页 共 22 页