sockets

Does close() on socket on one end, closes on the other end as well?

穿精又带淫゛_ 提交于 2021-02-10 18:15:59
问题 If ESTABLISHED socket (after connecting from client via connect() ), exits and thus kernel closes all open file descriptor, what happens to the other side? If the client sends FIN and the server ACK it (which is just half-closed state), but the server tries to read() on that socket, what happen then? I can imagine 2 situation: the socket server read() s on, is closed also. But in the server side there is no exit(), so noone has closed that socket at that side. So here I do not know how server

JNI/C socket connection error on Solaris 11

主宰稳场 提交于 2021-02-10 18:00:24
问题 Our application uses several socket connections (to localhost) implemented in c, with one connection using a jni/c socket connection. All of them call the same include to open the socket, and all are successful when we run the application on Solaris 10. Migrating to Solaris 11, we are finding that only the socket connections built in c are working, the one jni/c connection will not. I've added output to see what exactly is being sent to the connect call and it looks like the call is getting

I cannot make UDP Ports work on a Windows Azure Virtual Machine

心不动则不痛 提交于 2021-02-10 15:53:22
问题 I cannot receive a UDP packet on a Windows Azure Virtual Machine. I have done the following: On the Virtual Machine, via Windows Firewall, I opened up Port 1234* both Inbound and Outbound for both UDP and TCP protocols. I did not add any IP exclusions. The rule should apply to Domain, Private and Public profiles. I am allowing Block Edge Traversal. In the Azure Management Portal, I added Endpoints for my Virtual Machine instance. I added both UDP and TCP protocol endpoints. Public and Private

What is the predictable behavior of changing SOL_SOCKET, SO_RCVBUF on the fly on a UDP socket?

爱⌒轻易说出口 提交于 2021-02-10 15:35:42
问题 What should be expected to happen if we resize the input buffer of a UDP server socket on the fly on a Linux system? setsockopt(sock, SOL_SOCKET, SO_RCVBUF, ...) I am particularly interested in these questions: If I shrink below what is currently in the buffer, would this simply drop the oldest/newest? datagrams properly, or could it flush everything that's there, or worse could it corrupt data such as truncating a datagram? Would shrinking the buffer even save memory or something prevents

C++ Sockets: Enabling Promiscuous Mode in Windows

亡梦爱人 提交于 2021-02-10 14:56:56
问题 I'm trying to modify my current socketing program to capture packets in promiscuous. What I currently have is able to capture packets normally. I've seen other answer for how to do this on Linux but I need to find a way to accomplish this on Windows. Here is my code: int main(int argc, char const *argv[]) { SOCKET s; //The bound socket struct sockaddr_in server; int recv_len; //Size of received data char udpbuf[BUFLEN]; //A buffer for the incoming data. float data; //The data in the packet /

Socket.io 3 and PHP integration

青春壹個敷衍的年華 提交于 2021-02-10 14:50:23
问题 I using PHP SocketIO class to connect NodeJS application and send messages. Everything worked wonderfully with Socket.io 2 but after upgrade to version 3 the PHP integration is stopped working. When I send request I am getting this response: HTTP/1.1 101 Switching Protocols Upgrade: websocket Connection: Upgrade Sec-WebSocket-Accept: hNcappwZIQEbMz7ZGWS71lNcROc= But I don't see anything on NodeJS side, even when I tried to log any connection to the server by using "connection" event. This is

udp socket programming in php

。_饼干妹妹 提交于 2021-02-10 14:21:11
问题 I'm trying to run a udp socket on windows cmd..here's my server script.. <?php error_reporting(~E_WARNING); if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0))) { $errorcode = socket_last_error(); $errormsg = socket_strerror($errorcode); die("Couldn't create socket: [$errorcode] $errormsg \n"); } echo "Socket created \n"; // Bind the source address if( !socket_bind($sock, '0.0.0.0' , 80) ) { $errorcode = socket_last_error(); $errormsg = socket_strerror($errorcode); die("Could not bind socket

Socket.io http://localhost:3000/socket.io/socket.io.js 404 (Not Found) - How to configure socket.IO - nodejs, apache2, websockets

做~自己de王妃 提交于 2021-02-10 12:30:51
问题 Ok im having problems yet again with socket.io and express. When I run my node js application it begins to build before hitting an error " GET http://localhost:3000/socket.io/socket.io.js 404 (Not Found) " and "Uncaught ReferenceError: io is not defined" This is my second time working with web sockets and receiving the same error. For the previous app I fixed this problem by setting up a reverse proxy on my apache server. It looked like this; ProxyPass /socket.io http://localhost:3000/socket

how to connect sockets using static ip java

爷,独闯天下 提交于 2021-02-10 12:05:58
问题 I want to know if I can Connect Java sockets using a static IP Address. I've recently bought static IP from my ISP and I want to connect a Client Program that use Java socket with my laptop (as a server). I've tried it before in a closed network and it work normally, but when I've tried it with distributed network it doesn't work. Here is a piece of my code Server : ServerSocket serverSocket = new ServerSocket(5432); Socket client = serverSocket.accept(); Client : Socket socket = new Socket

how to connect sockets using static ip java

笑着哭i 提交于 2021-02-10 12:00:32
问题 I want to know if I can Connect Java sockets using a static IP Address. I've recently bought static IP from my ISP and I want to connect a Client Program that use Java socket with my laptop (as a server). I've tried it before in a closed network and it work normally, but when I've tried it with distributed network it doesn't work. Here is a piece of my code Server : ServerSocket serverSocket = new ServerSocket(5432); Socket client = serverSocket.accept(); Client : Socket socket = new Socket