FAQ Database Discussion Community


Exception in opening a socket at my IP address

c#,sockets,server
I am new in socket programming C#. I am trying to make a chat server between two computers but I am unable to do that because I cant start my Socket..... I gave the Server Program my IP address but gives me an exception... "The requested address is not valid...

Socket c++: recv function returns -1

c++,c,sockets,winsock2,recv
I'm trying to code a simple android client communicating with a windows server. I'm using sockets to achieve that and up to now, I was testing everything with a Linux machine (android client and linux server). So far, everything was working. Now i'm trying to set it up on windows...

can we open an UDP conection in javascript

javascript,sockets,udp
I think all is in the title, I want to use socket in js with UDP. I tried with WebSocket but : Uncaught SyntaxError: Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. 'udp' is not allowed. Is it possible with socket.io ? if yes how...

Python3:socket:TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'

sockets,python-3.x
I am try to use python socket package to implement an echo server. But it continuously occurs the error: TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes', is there any errors in my code? here is the error: Exception in thread Thread-1: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/threading.py",...

UDP sockets in C not working

c,sockets
I am just trying to make a UDP connection for the first time using C on linux. I have a server which is transmitting a number every second and I have a program which is receiving. The transmitter seems to be wroking but the receiver does not seem to be...

Java socket receives byte array where each byte is 0

java,sockets,bytearray
I am making a program which takes a file, and sends it via socket to client. Client receives it and saves it to a file. That is what it is supposed to do. But somehow, byte array which client receives, contains only 0 bytes, so my output file is empty....

When BSD socket reports that RST was received, if not everything was read yet

c,sockets,tcp
Lets imagine the following data sequence that was sent from the server to the client: [data] [data] [data] [FIN] [RST] And lets imagine that I'm doing the following on the client side (sockets are non-blocking): char buf[sizeof(data)]; for (;;) { rlen = recv(..., buf, sizeof(buf), ...); rerr = errno; slen...

C++ Winsock programming, receiving no response from HTTP protocol

c++,sockets,http,tcp,ip
As the title says, I've just began studying how the TCP/IP protocol applies to C++, so I tried sending a packet to any random website (In this case www.nasa.gov), using the IP address (DNS Resolver) and a random port (I went for 80), and I am receiving no answer. I...

ZMQ: No subscription message on XPUB socket for multiple subscribers (Last Value Caching pattern)

python,sockets,proxy,zeromq,publish-subscribe
I implemented the Last Value Caching (LVC) example of ZMQ (http://zguide.zeromq.org/php:chapter5#Last-Value-Caching), but can't get a 2nd subscriber to register at the backend. The first time a subscriber comes on board, the event[0] == b'\x01' condition is met and the cached value is sent, but the second subscriber (same topic) doesn't...

Nodejs connect mysql socket to another host?

mysql,node.js,sockets
Hello below is my Nodejs code is working fine into my local computer. var client = mysql.createClient({ user: '(your user here)', password: '(your password here)', host: '127.0.0.1', port: '3306', _socket: '/var/run/mysqld/mysqld.sock', }); but how can i write the path of "_socket" when i connect with another server. my database located...

Sending a Mat object over socket from Java to Java

java,sockets,opencv,mat
I understand Sockets over Java and sending Int,String,bytes etc over it. What i just want to know is that is there a way to decode a Mat object to byte array and then send it over java socket and then retrieve back the Mat object from the byte received? Till...

How to identify a client connected to AF_UNIX socket?

python,sockets
What is the meaning of the "client address" in case of AF_UNIX sockets in Python? sock = socket.socket( socket.AF_UNIX, socket.SOCK_STREAM ) sock.bind( "/tmp/sock" ) sock.listen( 1 ) while True: connection, client_address = sock.accept() print( client_address ) # prints : b'' Is there a way to obtain on the server side...

Detecting incoming port for TFTP data?

c,sockets,udp,tftp
I'm working on implementing a TFTP client (UDP socket). Currently I have to switch off the entire firewall on my Windows 8 machine or else the data doesn't reach the TFTP client. The outgoing connect request happens on port 69, but the first data packet from the TFTP server is...

Coverity - overrun of struct type

c,sockets
I am getting the following error through the coverity tool - overrun-buffer-arg: Overrunning struct type in_addr of 4 bytes by passing it to a function which accesses it at byte offset 7 using argument "8UL". sample code: static u_long addr; static struct sockaddr_in remote_server; addr = inet_addr(remote_servername); memcpy((char *) &remote_server.sin_addr,...

C: Linux to Windows: Sending text file over TCP produces not exact copy on the Windows side

c,linux,windows,sockets,tcp
I'm writing a system to gather software/hardware info on Macs to put it into a Windows-based SQLite3 database. Schema is as following: agent on Mac - gather data, then sends it over Internet, using SSL, to small Linux server in DMZ (this part works as intended so far) Linux server...

ZeroMQ pattern for multiple asynchronous requests to single endpoint

sockets,asynchronous,zeromq
I'm using zmq to develop a distributed application having the following network topology: a client node that initiates a request and a server node that replies to requests. Since the client is a node.js application I can't block after a send call to wait the response, so the scenario is...

Message Ordering with Asynchronous I/O (epoll)

c,sockets,scalability,epoll
Say that I've implemented a epoll-based TCP server where each thread is running something very similar to the below (taken from the epoll manpage where kdpfd is the epoll file descriptor and listener is a socket that is listening on a port): struct epoll_event ev, *events; for(;;) { nfds =...

The requested address is not valid in its context when i try to listen a port

c#,sockets,listener,port
I am trying to connect to a sensor using network, the sensor's ip is 192.168.2.44 on port 3000; My Code: byte[] byteReadStream = null; // holds the data in byte buffer IPEndPoint ipe = new IPEndPoint(IPAddress.Parse("192.168.2.44"), 3000);//listen on all local addresses and 8888 port TcpListener tcpl = new TcpListener(ipe); while...

Does FD_ISSET() return the file descriptor which received data

c++,c,linux,sockets,select
I have the following code fd = listen_socket(INADDR_ANY, CLIENT_PORT, client_config.interface); fdr = raw_socket(client_config.ifindex); if (fd >= 0) FD_SET(fd, &rfds); if (fdr >= 0) FD_SET(fdr, &rfds); max_fd = fd > fdr ? fd : fdr; retval = select(max_fd + 1, &rfds, NULL, NULL, &tv); if (FD_ISSET(fd, &rfds)) { .... } else...

Mixing Java NIO with IO input streams read operation

java,sockets,io,nio
I need to use NIO to allow the server side to support timeout on write operations, but handling reading operations on the socket channels complicates my program. I was wondering if it's possible to write to the sockets using NIO but to read using regular IO, something like ((SocketChannel) selectedKey.channel()).socket().getInputStream().read(buffer)...

Do I need a queue for a socket pair pattern?

python,sockets,tornado
I'm writing a Tornado server that allows for communication between sockets in a kind of pairing pattern. This looks something like def write_to_paired(self, message): if (paired == online): paired.write_message(message) class typeASocket: def on_message(message): write_to_paired(message) class typeBSocket: def on_message(message): write_to_paired(message) These connections will only ever be 1:1. Do I need a...

Handling Keyboard Interrupts

sockets,exception-handling,sml,smlnj,keyboardinterrupt
I've got a minimal TCP server running in the SML/NJREPL, and I'm wondering how to gracefully close the listener socket on a keyboard interrupt. A stripped-down version of the server is fun sendHello sock = let val res = "HTTP/1.1 200 OK\r\nContent-Length: 12\r\n\r\nHello world!\r\n\r\n" val slc = Word8VectorSlice.full (Byte.stringToBytes res)...

Closed system shellcode experimentation (segfault)

c,sockets,segmentation-fault,shellcode,experimental-design
I am taking an online software security course. I am attempting to experiment with shellcode. I have written a vulnerable server, an injection program, a (probably broken) shellcode I convert to assembly, that I then strip with a python script. I then compile and run everything with a shell script....

Use Sockets in multiple *.cpp files

c++,sockets,server
As you can see in the Title box, I´d like to find a way how to use my sockets in multiple cpp files. #pragma comment(lib,"ws2_32.lib") void main() { WSADATA wsaData; WSAStartup(MAKEWORD(2,0), &wsaData); SOCKET slisten,client; slisten = socket(AF_INET,SOCK_STREAM, 0); //and so on... } This is the way I use the ws2_32.lib...

Drawing with ncurses, sockets and fork

c,sockets,fork
So I'm doing the barbershop problem but now I want to make it 'visual' and network-friendly. When the server starts up, awaits for clients to connect, each time a client connects it draws a 'P' that travels around the screen up to the barber position. I do this with NCurses...

My simple client crash everytime it tries to connect to my python socket server

python,sockets,python-3.x,serversocket
My client crash everytime it tries to connect to my python socket server. I dont know why but but my server seams to start up fine then when i start up my client it establishes a connection to the server but it crash direct. Im doing almost as what they...

Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?

windows,sockets,winsock,winsock2
I'm developing a server-client application using WinSock. Does using the same WSAOVERLAPPED with both WSASend and WSARecv works well? Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?...

Get all room name in socket.io

javascript,sockets
im using socket.io v1.3.5 to create chat room, now i have a code: console.log(socket.rooms); It get output: [ 'pBtWJZqN23xAJw0sAAAE', 'test' ] [ 'GPnwtq3gi9t1RZcCAAAD', 'Lobby' ] [ 'n7tTlvoH1M7foT3ZAAAC', 'Lobby' ] i had 3 socket.id in 2 room 'lobby' and 'test'. I want to get an array of room name like this:...

Reading packets from a client stops after 1 or 2 received

c,linux,sockets,server
I'm writing a server program in C that will read commands from the client. Commands are in the form of 5 byte packets, and the client will be sending a bunch of them in succession. The code I have to read each command is: while(1) { char buffer[1024]; int alreadyread...

What type of database is the best for storing array or object like data [on hold]

database,node.js,sockets
I'm just curious what the best method would be if I'm trying to have a bot running on my Node server that I could play Blackjack against. But for multiple connected clients via sockets, each connected socket will have their own bot to play against but I need some way...

Sails.js sockets. Good and bad sides. Difference with socket.io

javascript,node.js,sockets,socket.io,sails.js
So I am learning Sails.js at the moment and more specifically the integrated socket functionality of the framework. I do like the framework because it is very good for building APIs. My question is can you guys give me some comparison between socket.io and the sails sockets. I mean good...

Socket don't save values in list

java,multithreading,sockets,arraylist
I'm new in network developing in Java and I want to create a simple Socket server, that get values from client and collects all of them in ArrayList. I wrote an example code, but in server side it not collecting the strings. This is my server side: Server public class...

Datanode and Nodemanager on slave machine are not able to connect to NameNode and ResourceManager on master machine

java,apache,sockets,hadoop,tcp
I have installed hadoop on two node cluster- Node1 and Node2. Node1 is master and Node2 is slave. Node2's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1 respectively. However Node1's datanode and Nodemanager are not able to connect Namenode and Resourcemanager on Node1. Node1: jps...

Using sockets to build real time chat for iOS?

ios,objective-c,sockets,chat,real-time
If I wanted to build a real time chat app for iOS using Objective-C, what would be the best way of going about it?

C sockets: Exit client after all data is received

c,sockets
I am a C newbie learning sockets. I wrote a client-server program to receive a file and write it to another file. The program itself works fine - the file is read by server properly and the client receives it in full, but the client does not exit after receiving...

Merging socket request/response in a function

c#,sockets,mono
I'm trying to implement a client/server application communicating through sockets. The communication works fine and I can match and execute different functions. Most of the packets are from request / response type and are matched with a persistent sequence number. The problem I'm now stating is that I can't lead...

Python SimpleXMLRPCServer : Socket Error , Connection Refused

python,sockets,xmlrpclib,simplexmlrpcserver
I am trying to list the contents of a directory on a server. If the client and server code is executed on the same machine, it works perfectly. However, running the client code from another machine using the IP of the server gives me a Errno 111:Socket Error. Connection Refused...

How is Ctrl+C key behaves in a TCP connection

sockets,tcp,control-c
I'm studying network and specifically tcp connection and i wondering in a situation that you connect remotely to a server using tcp connection and sending command line to execute some actions, How they handle sending a ctrl+c signals? Is it sends a normal tcp package that in data section describes...

How to build Linux kernel to support SO_ATTACH_BPF socket option?

c,linux,sockets,linux-kernel,bpf
I want to build a application which supports eBPF on CentOS 7 (the kernel version is 3.10.0): if(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, prog_fd, sizeof(prog_f)) { ...... } So I download a 4.0.5 version, make the following configurations on: CONFIG_BPF=y CONFIG_BPF_SYSCALL=y Then follow this link to build and install a 4.0.5 kernel. After...

Running a python script online for free (and accessing using ip and port) [closed]

python,sockets,web-hosting,host
I coded a python script to run a server for my iPhone messaging app. This app/server uses (currently) port 80 and ip localhost to run the server as I am running it on my computer so far. Now I need a host to run the script and allow me to...

No transports available

sockets,firebase,react-native
I recently was trying to upgrade my react-native app to use react-native 0.5.0 and firebase. According to this article the react-native sockets are working and the full firebase sdk should be available. I was previously using firebase-debug and @badfortrains react-native fork with success following the example project https://github.com/badfortrains/wsExample. Since upgrading...

How to catch socket exceptions on TcpInboundGateway?

java,spring,sockets,spring-integration
I'm using TcpInboundGateway from spring-integration for a socket client. In TcpInboundGateway.doOnMessage() the stream is send via the socket connection. If an exception occurs eg because the socket is closed, there is just a spring error log "Failed to send reply". BUT I'd like to handle those socket errors explicit. How...

GET and PUT commands with C++ Server-Client

c++,sockets,client,server
I'm trying to create a server, client put and get method but I don't really know where to start, how do I make the server run the commands I process. Any help would be much appreciated. Client file void Copy(char *filename1,char *filename2); int main(int argc, char **argv) { if(argc ==...

Sending files in socket programming tcp

c++,sockets,tcp
I am trying to implement a simple file transfer. Below here is two methods that i have been testing: Method one: sending and receiving without splitting the file. I hard coded the file size for easier testing. sender: send(sock,buffer,107,NULL); //sends a file with 107 size receiver: char * buffer =...

recv function always gives me the same buffer

c++,sockets,winsock,winsock2
This question is kind of a follow-up of a question that I previously asked. Basically I had a c++ server running in ubuntu and I'm now trying to make this code works in windows. I am having some issues with windows socket as it's my first time using them. After...

“Un-associate” socket from completion port

c++,sockets,winapi,winsock,iocp
CreateIoCompletionPort() is used to associate a socket with a completion port. However, when this socket is closed, then I need to "un-associate" it from the completion port. How can I do that?

C# Winform to Connect to Device Using IP

c#,winforms,sockets
I need to create an application that allows the user to connect to a device (a piece of hardware that will be sent arguments/commands) via wifi (wifi is end goal but I am settling at the moment for any connection) and then send commands to said device. I know some...

Set a timeout for an UDP socket with Twisted (python)

python,sockets,twisted
I'm using Twisted in a python program. I send data every minute and receive data on a UDP socket and I need to set a timeout. I found a way to do this, but I would like to know if it's a good way to do that. This is the...

Java Socket returns EOF on low bandwidth

java,android,sockets
I'm making an Android app for playing online radio. I'm using Java Socket for connection and it's InputStream to read stream data. Actually there is HTTP request and response without length with content type such as audio/mpeg. All works fine until bandwidth becomes low (using mobile internet or connected to...

why do I need to update nfds in select call when I remove fds from master set?

c,sockets,select
Given a select call like this: select(fdMax+1, &readFds, NULL, NULL, &timeoutVal) where readFds are updated whenever new fd is added existing fd is removed Whenever new fd is added, I update the fdMax. However, whenever existing fd is removed, I'm wondering if I really need to update the fdMax also...

Socket.IO message doesn't update Angular variable

javascript,angularjs,node.js,sockets
I have a socket.io client-server setup with AngularJS running on the client. // Server.js var io = require('socket.io')(server); io.on('connection', function (socket) { socket.on('message', function (msg) { //console.log(msg); console.log(msg); io.emit('message', msg); }); }); As observed, it essentially emits a message events with the data stored in the variable msg. And then...

websockets - reject a socket connection

node.js,sockets,websocket
I'm using ws as the socket library for my node.js library. so my question is, how can I reject a connection if the user doesn't pass the authorization process. var WebSocketServer = require('ws').Server; var wss = new WebSocketServer({port: 6969}); wss.on('connection', function(socket){ // if the socket.upgradeReq.headers.cookie doesn't exists, reject the client...

Ping a server without freezing the Thread

java,multithreading,sockets
I tried to use multiple threads, sadly no luck: public synchronized boolean pingServer(final String ip, final short port) { final boolean[] returnbol = new boolean[1]; Thread tt = new Thread(new Runnable() { @Override public void run() { try { Socket s = new Socket(ip, port); s.close(); returnbol[0] = true; }...

C++ overload << operator for class object acting as stream

c++,sockets,tcp,operators
So I've browsed a bunch of other threads, but none pertain to the questions I have on this exact topic. I am writing a C++ library to do socket communication. I have a TCP socket class which handles all operations on a TCP socket (setup, read/write, etc). I want to...

Jetty Web Socket Timeout

javascript,sockets,websocket,jetty
I am trying to establish a Web Socket Connection using Jetty 9.3.0 RC. function checkDetails(port) { var ws = new WebSocket("ws://localhost:9995/application"); ws.onopen = function(event) { console.log("onopen called..."); } ws.onerror = function(event){ console.log('onerror called...'); } ws.onmessage = function(event) { console.log("onmessage called..." + event.data); } ws.onclose = function(event) { console.log("onclose called..." +...

What could cause a Java TCP socket to close?

java,sockets,tcp
I'm trying to use an implementation of an MQTT client specifically Paho Java client in Android, and trying to trace where I get an EOFException error. Specifically this happens on in.readByte();. public final byte readByte() throws IOException { int temp = in.read(); if (temp < 0) { throw new EOFException();...

How to secure blueprint access in Sails.js

javascript,node.js,sockets,sails.js
So I'm pretty new to Sails.js but it seems to bring a lot to the table like these blue prints, Right now I have 2 models, Accounts / Friends It is using association as Accounts has many Friends On my client side I have a way to send notifications to...

Specified argument was out of the range of valid value to get data from network in c#

c#,sockets,buffer,streamwriter
I am trying to send a command to a sensor and get the data from it using this code : const int PORT_NO = 3000; const string SERVER_IP = "192.168.2.44"; //---listen at the specified IP and port no.--- IPAddress localAdd = IPAddress.Any; TcpListener listener = new TcpListener(localAdd, PORT_NO); Console.WriteLine("Listening..."); listener.Start();...

Updating a two-way java messenger chat to allow multiplie users

java,multithreading,sockets,messenger,instant
I just finished an youtube series about creating an instant messenger chat, which works between the server and one client through sockets. However, I'd like to improve this chat so multiple clients can connect at the same time. The server works fine, and so does the first client. On the...

ipv6 python sockets not working

python,sockets,ipv6
I have a simple client server program and the server side works but for some reason I can't get the the client to interact to the server. I am able to launch the server and use nc -u ::1 50007 and connect to it and it works as intended. Server...

How to choose zmq maximum buffer size properly?

c++,c,sockets,zeromq
According to ZMQ-manual The ZMQ_SNDBUF option shall retrieve the underlying kernel transmit buffer size for the specified socket. A value of zero means that the OS default is in effect. For details refer to your operating system documentation for the SO_SNDBUF socket option. How can I get it in a...

Handling POST request via Socket in Java

java,sockets,http,post,request
I'm trying to handle a simple POST Request in Java using a Socket. I can receive the request header and answer the request without any problem, but I certainly can not get the body of the request. I read somewhere that I'd need to open a second InputStream to achive...

parameter error in python script & TOR proxy server

python,sockets,subprocess,tor,proxy-server
I am Noob in Python. My Boss instructed me to run this python script with TOR proxy server running. He told me to pass this parameter this way: python DownloadYP.py /Users/myfolder/ japan http://www.jpyellow.com/company 1 222299 He configured it on MAC. I am using windows. So my parameter is this way:...

“someVariable is None” always false w/ value derived from optparse result

python,sockets
I'm really getting mad 'cause of a problem I do not manage to get through while programming a simple and didactic portscanner in python. Here's the code: def main(): parser = optparse.OptionParser("usage%prog "+\ "-H <target host> -p <target port>") parser.add_option('-H', dest='tgtHost', type='string', \ help='specify target host') parser.add_option('-p', dest='tgtPort', type='string', \...

Python sending a file over sockets

python,sockets
I am trying to write a script that requires files to be sent from server to clients and am having issues with the files being completely sent when the destination is not the local host. So when the server and client are on different machines the client seems to receive...

Communicating between a PC and UR5 Universal Robotics Robot Arm using TCP/IP LabVIEW

sockets,networking,tcp,labview,robotics
I have a UR5 Universal Robotics Robot Arm and PC connected via ethernet that I am attempting to have talk to each other via LabVIEW (just send strings back and forth). I have already managed to read communication from the robot to the PC using the TCP Listen VI and...

Socket listener in IntentService

android,sockets,android-broadcast,android-intentservice
In my program, I am receiving data via socket in an IntentService class and then sending the same as a broadcast to activity. Activity processes the input and prepares an output. while (true) { socket = serverSocket.accept(); //Read data from socket //Publishing as a broadcast } Now my question is...

Sending double with tcp from java to C#

java,c#,.net,sockets,tcp
I have a Java SocketServer that sends doubles to a C# client. The sever sends the doubles with DataOutputStream.writeDouble() and the client reads the double with BinaryReader.ReadDouble(). When I send dos.writeDouble(0.123456789); and flush it from the server the client reads and outputs 3.1463026401691E+151 which is different from what I sent....

socket io get id of the disconnected socket

node.js,sockets,session-variables
I code a chat room using socket.io >1.0 In my chat room application I try to understand who is just disconnected. To do that I need to access socket's id. After the disconnect event is triggered, socket.on('disconnect', function(socket){ //need to learn socket's id here } I cannot check who just...

Unable to receive data after connection getting Bad file Descriptor error

c,linux,multithreading,sockets
I am working on a Multi-threaded Server application in C using Pthreads(Linux). My system is dual boot.Windows 7 as well as Ubuntu. I restarted my PC and booted into Windows from Ubuntu, Before restarting my server application was working Fine.After i again booted to ubuntu from windows. and started my...

Java Restart a Socket

java,multithreading,sockets
I have a socket, which is initialized inside a thread, here is my code. public class Receiver extends Thread { public static boolean connect() { boolean result; try { client = new Socket(serverIPString,Integer.parseInt(serverPortString)); result = true; } catch (IOException e) { result = false; WriteExceptions.writeToFile(e); } return result; } public...

Is TcpClient a single connection use? How do I send a second message?

c#,sockets,tcpclient
I have a TcpClient object which can connect to a foreign program. I can send one message (xml serialized message). But as soon as I close my network stream my TcpClient closes and disposes. And the second time I try to send a message via my TcpClient I get an...

Moving a SIte from Drupal to Raw PHP … Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

php,mysql,sockets,drupal,drupal-7
I don't understand this the error, Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) I am not familiar with drupal or any frameworks. Please advice me about this error and if I want to host my raw php site which I created in local WAMP server and...

Authentication in Socket.io

node.js,sockets,socket.io
I'm going to try to authenticate a connection on socket.io. Currently, the user is first authenticated via a REST API, then, I send the user a JsonWebToken with the authenticated user's username. After I open the connection between the client and the server, my plan is to temporarily delete that...

Connect to pressure sensor using c# to get the value ,doesn't work in c#

c#,sockets,listener,tcpclient,tcpserver
I have a sensor ,i connect to this sensor using network cable.I should send a command to this sensor to get the value . The sensor ip is :192.168.2.44 my computer ip:192.168.2.111 I used a program called hercules as you can see here to connect to the sensor : In...

cloudflare SSH and sockets: how to run them together?

sockets,socket.io,cloudflare
I am using a flexible SSL from cloudflare, so my site is now https://www.example.com Inside my site, I use socket.io : server = 'http://direct.example.com'; socket = io.connect(server+":1445" , {'force new connection': true }); Problem is I got: Mixed Content: The page at 'https://' was loaded over HTTPS, but requested an...

Multiple socket connection

c#,visual-studio,sockets
I have 6 devices, price checkers. I have a project which the client in a supermarket will scan a product on this device and it will return the price of the product. I have managed to connect with one device, get the bar code and send data. But I can...

Creating Multi-user chat with sockets on python, how to handle the departure of the server?

python,sockets
I was trying to implement a multiuser chat (group chat) with socket on python. It basically works like this: Each messages that a user send is received by the server and the server sends it back to the rest of the users. The problem is that if the server close...

Why specify a host when creating a socket server in Python?

python,sockets
When setting up a server socket in Python, the socket.bind(address) method allows you to specify the address as a tuple like (host, port). However, the first example shows that you can specify the host as '' as a shortcut to mean all interfaces (IPv4). I can see how it could...

Linux local communication sockets: Why is bind() not failing as expected?

c,linux,sockets,bind
I have this server application that sets up a local communication stream socket for clients to connect to. If a second instance of the server is launched and it tries to bind to the same address (file name), bind() should fail with EADDRINUSE. But it does not. Why? Here is...

Are the C functions recvfrom and sendto mutually exclusive?

c,linux,sockets,udp,thread-safety
I have one thread calling recvfrom with a timeout of 100 ms in a loop. Another thread calls sendto periodically. Does the sendto function wait until the recvfrom is released by the timeout (or a successful read) or does it send the data during that period of time....

Chrome UDP sockets not receiving from remote machine

javascript,sockets,google-chrome,udp,google-chrome-app
I'm working on a Google Chrome app that contains the following code: var socket = chrome.sockets.udp; var PORT = 5005; var HOST = '127.0.0.1'; socket.create({}, function(sockInfo){ socket.bind(sockInfo.socketId, HOST, PORT, function(result){ socket.onReceive.addListener(function(info){ // do stuff with the packet data }); }); }); This mechanism worked perfectly when I was sending data...

Refactor an IO recursive loop into a monad folding in Haskell

sockets,haskell,network-programming,io-monad
I writing a tcp server, and here's my main loop method: serverLoop :: Socket -> IO () serverLoop sock = do (conn, _) <- accept sock forkIO $ handleConn conn serverLoop sock (Note: handleConn :: Socket -> IO () is a function specific to my program.) I would like to...

Find method contents from a method in superclass? (Java/Eclipse)

java,eclipse,sockets,oop
I want to find the contents of the java.net.ServerSocket accept() method (because I am trying to override it so it returns a different type). Is this possible in Eclipse, or for that matter, in Java? Thanks....

Only one usage of each socket address (protocol/network address/port) is normally permitted in c#

c#,sockets,listener,tcpclient
I am trying to connect to a sensor using network, the sensor's ip is 192.168.2.44 on port 3000; try { byte[] byteReadStream = null; // holds the data in byte buffer IPEndPoint ipe = new IPEndPoint(IPAddress.Any, 3000); //listen on all local addresses and 8888 port TcpListener tcpl = new TcpListener(ipe);...

Implicitly linked C Program is not connecting to localhost

c,linux,sockets,shellcode
Where am I going wrong with my experimentation: I am trying to experimentally deduce the details of creating a simple shellcode. My first impression was I probably would not be able to use imports, as my shellcode is not linked by the compiler of the target program. I then began...

How to get the socket's specific error reason when POLLERR happens?

sockets,epoll
When POLLERR comes up after polling, how can I determine the specific error reason?

Haxe server-client exchange on all platforms

sockets,websocket,client,server,haxe
I'm developing client-server application on haxe. I want client side to be compiled to javascript from haxe, but there is a big chance, that other languages will be also needed. I cannot find universal way of doing it. Though, I can make it with websockets, when it comes to jabascript,...

Mysterious number of chars read with read() in simple chat in C?

c,sockets,chat
I have coded a simple TCP chat in C language. The server's job is to receive messages from the client and to send them back in reverse order. The result should look like this: Client: "Hello" Server: "olleH" When I apply "strlen()" to "olleH", the returned length is not 5,...

Sockets make no sense?

javascript,node.js,sockets
I'm using the 'ws' library for Node.js. I can write code that sends data from my server to my client, posting a date and time update, and closes the socket when I click a button; var wss = new WebSocketServer({server: server}); console.log("WebSocket server created"); wss.on('connection', function(socket) { // SEND DATE...

Can not connect to an abstract unix socket in python

python,c++,sockets,unix,unix-domain-sockets
I have a server written in c++ which creates and binds to an abstract unix socket with a namespace address of "\0hidden". I also have a client which is written in c++ also and this client can successfully connect to my server. BTW, I do not have the source code...

PHP/Java socket communication not working

java,php,sockets,send
I've been stuck for two days with the following problem: I wrote a java socket server which can receive and send data to a socket hosted at 'localhost:64005'. I can connect to it via php and send or receive messages. However I cannot send and then receive an answer. I've...

Python 3.4 listening to selected server and port

python,sockets
This code can create socket, connect to selected server and port, and print reply. I have a question, how can I listening to the port longer than one moment? E.g. I want listen to selected port for 20 seconds and print all packets which will come at this time. Is...

Making socket communication using bin_prot

sockets,ocaml,communication
I want to make Socket communication using bin_prot in OCaml. However, I can't find any detailed explanation or example to do that. I made Socket communication in the other way before, so I know the flow of it. Do you have good explanations or examples to make Socket communication using...

UDP and TCP always use same IP for one client?

python,sockets,networking,tcp,udp
I've made a server (python, twisted) for my online game. Started with TCP, then later added constant updates with UDP (saw a big speed improvement). But now, I need to connect each UDP socket client with each TCP client. I'm doing this by having each client first connect to the...

Popen.subprocess in threads

python,multithreading,sockets,popen
I have a client server code in python, wherein the client queries the server about a process running on the server and provides the memory threshold. If the process consumes more memory than the threshold,the server kills the process and restarts it. The problem is since I am creating a...

My get request for http is very slow [closed]

sockets,http,get
I need to make a request through a socket and catch the response but in while block goes slow. I think i have written enough information, but if someone can help me and need additional information i will answer him/her. Thank you. import java.io.InputStream; import java.io.PrintWriter; import java.net.InetAddress; import java.net.Socket;...

Sending image from client on java to server on python

java,python,mysql,sockets,server
I have been trying to create a program that runs a client in Java and the server in Python. My overall goal is to upload a picture from the client on Java to the server on Python and store it on a mysql server. I haven't tried yet to convert...

psuedo TCP multicast with os.dup2() in python?

python,sockets,tcp,multicast,dup2
The idea is to multicast the same content from one single resource to multiple receivers at once. I came up with the following code: #!/usr/bin/env python # coding: utf8 import socket, os c = socket.socket() c.connect(('127.1', 4343)) s = socket.socket() s.bind(('127.1', 8989)) s.listen(3) while 1: conn, addr = s.accept() print...

Java read bytes from Socket on Linux

linux,windows,sockets,network-programming,raspberry-pi
I'm trying to send a file from my Windows machine to my Raspberry-Pi 2, and I have a client and a server. The client should be able to send a zip file over the network to my server on my linux machine. I know my client and server work on...