FAQ Database Discussion Community


Raw HTTP1.1 request implementaion in Java not getting terminated

java,network-programming
I have implemented httpClient by using the code from the below link. I am able to get the html repose and program is getting terminated when the HTTP request is of version 1.0. https://www3.ntu.edu.sg/home/ehchua/programming/webprogramming/HTTP_Basics.html If I change the version to 1.1 , the reponse is printed,but program is not getting...

Thread blocked indefinitely in an MVar operation

haskell,concurrency,network-programming
I have been attempting to debug a problem when using multiple MVars, however to no luck. My code uses two MVars: one to store the servers current state, and another to pass network events to and from the client threads. However after connecting and disconnecting several times, the server stops...

How to assert a spawn is “filled”?

unity3d,network-programming,spawn,photon
I have two spawn spots where a player will show up upon connection. I need that, when one of the players connects on one of the spots, any other player will always spawn at the other spot. Here's some visual in case it helps: https://goo.gl/Y0ohZC Thanks in advance, IC...

Does SleepEx guarantee that all pending completion callbacks get called before timeout?

c++,windows,multithreading,sockets,network-programming
I have a C++ program that uses overlapped IO for network communication. The main thread has a loop that calls SleepEx(5, true);. There are also two TCP sockets. I assume that the completion callbacks are called during the alertable wait. Assume also that by the time SleepEx gets called both...

Remove 0-byte (UTF-8) characters in String

java,string,utf-8,network-programming,bytearray
I am currently programming a multi-player game, and I am working on the networking side of it all right now. I have a packet system set up, and the way it works (with Strings at least) is that it takes a number of characters to a maximum of "X" characters....

Timing packets on a traffic server

python,unix,networking,network-programming,server
I have a proxy traffic server which is an extra hop on a network and is handling large quantity's of traffic. I would like to calculate the cost in seconds of how long it takes for the proxy server to handle the incoming request, process them and forward it on....

Why are multicast messages on the same port but from different groups combined?

sockets,network-programming,multicast
On an Ubuntu 14.04 server I have two processes, each listening for multicast messages on the same port, but from different groups. I would not have expected this, but each sees traffic from both the group they want, and the other group. As far as I can tell, this is...

Implementing chat client following Beej's guide to network programming

c,sockets,network-programming,posix
I'm trying to learn network programming by following Beej's guide. I have compiled the server in section 7.2, that's using select(), and now I'm trying to write a client for that server, so I could open two terminals on my machine and be able to chat. I have started off...

C# TCP Connection to Siemens S7 PLC - Network Newbie

c#,network-programming,port,plc
I want to establish a two-way communication setup between a PC and a s7-PLC. So far I've been successful setting this up one-way with the use of an open source driver found here: https://github.com/killnine/s7netplus This driver allows me to tell the PC to fetch data from the PLC, and also...

reach local WildFly server over LAN

java,java-ee,network-programming,wildfly
So my firewall is OFF and my standalone.xml contains <interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:127.0.0.1}"/> </interface> <interface name="public"> <any-ipv4-address/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:192.168.56.1}"/> </interface> </interfaces> Running netstat gives C:\Users\Ram>netstat -an | find "8080" TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING TCP...

How to read/send packets correctly?

c++,network-programming,packet
I am trying to send packets via UDP, and I am not allowed to use SOCK_RAW (school project). The packet I am sending has a header struct ip and a string data part. I put them into one char array (the packet itself is configured correctly). Here is how I...

Best way to handle multiple sockets in Qt server application?

c++,qt,sockets,network-programming
I'm making a simple client server program for a school project in Qt, but I've run into problems on how to handle multiple new connections to the server. The code I have for new connections so far is pretty basic: void LoginServer::newConnection() { logSock = server->nextPendingConnection(); if(!logSock->waitForConnected(500)) { qDebug() <<...

Multicast listening and interface IP address change

c,linux,network-programming,multicast
I am binding to a multicast group and port to listen a multicast stream. Since adding the group membership (via IP_ADD_MEMBERSHIP) requires specifying a specific network interface, what will happen when that interface IP address changes? Do I have start again with a new socket and add membership? This is...

urllib.request.urlopen(url) how to use this function with ip address?

network-programming,urllib2,urllib,urlopen,urllib3
I'm working on Python3 with testing page load times so I created a local apache server for compare but the problem is I use urllib.request.urlopen(url) function which doesn't allow me to use my own ip address. Is there anything that helps me to get page with only ip address. Here's...

Bash - Script that reads .txt file and stores the info in variables to be used later

bash,shell,unix,network-programming,network-interface
I'm working on a bash script that must be able to create "network interface profile configurations", store them in any kind of file (.txt I guess) and then, if called with parameters, eg: ./myscript eth0 myprofile must execute the commands in myprofile.txt to configure that network interface. So, right now,...

Network Service Discovery on Windows Phone

c#,network-programming,udp,windows-phone-8.1
I was looking to write a simple desktop app and a corresponding mobile app, the scenario would be: I run the desktop app on my laptop I run the mobile app on my Lumia (on the same wifi network) The phone app somehow finds and connects to the desktop app...

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...

Getting started with network programming in Qt [closed]

c++,qt,network-programming,boost-asio
I just started a summer job at my university doing work in a lab, and I've been given a rather large, vague problem to tackle without much guidance so I was hoping someone could help point me in the right direction. Essentially it's a 3-d world built in Qt using...

I can't find DSCP field in IP header, only the deprecated TOS field

c,network-programming,ip,qos
I will try to garantee some QoS with my access point made with Raspberry Pi. Before starting, I'm getting my hands dirty: I read about the tcp, udp and ip headers. In the IP header description I saw the DSCP field, originally defined as the Type of Service field. DSCP...

Multiple socket 'handshaking' in UDP network using SFML C++ libraries

c++,sockets,network-programming,udp,sfml
I am coding a real-time, network program with UDP protocol using SFML libraries. The server will be handling all of the processing, sending packets to the client and vice versa. I need a method to synchronize the screen updates, because there will be a real-time user interface on both sides...

Waiting to return main block until its encapsulated children are finished

swift,rest,asynchronous,network-programming
I'm quite new to asynchronous networking in Swift, and am currently using the SwiftHTTP library to run HTTP GET requests. I've found myself in a situation whereby I run a for loop within an asynchronous GET block, which itself contains a 'secondary'/child GET block, as follows: request.GET("https://", parameters: nil, success:...

applying a function to graph data using mapReduceTriplets in spark and graphx

scala,network-programming,apache-spark,graph-algorithm,spark-graphx
I'm having some problems applying the mapReduceTriplets to my graph network in spark using graphx. I've been following the tutorials and read in my own data which is put together as [Array[String],Int], so for example my vertices are: org.apache.spark.graphx.VertexRDD[Array[String]] e.g. (3999,Array(17, Low, 9)) And my edges are: org.apache.spark.graphx.EdgeRDD[Int] e.g. Edge(3999,4500,1)...

In a forward search algorithm, what happens if both items are equal? [duplicate]

algorithm,network-programming,computer-science,dijkstra
This question already has an answer here: Dijkstra's algorithm: What to do if there are two or more nodes with minimal weight? 1 answer In a forward search algorithm, what do you do if both items are equal? The forward search algorithm stems off of Dijkstra algorithm Forward Search...

uploading image in swift with multiple parameters

ios,swift,network-programming
I am trying to upload an image to a backend client using swift. Trouble is I can't seem to get the formatting correct for the httpbody. I do not want to use a multipart form for uploading as I don't know how to handle that on the backend. Here is...

QTcpSocket not emit any error or connected signals

c++,qt,network-programming,signals,qtcpsocket
I have a small project which send some data over network using QTcpSocket. The server works fine but the client(code here) seems does nothing. If I set breakpoint at tcpSocket.connectToHost("127.0.0.1",port); it does jump in, but not any slots I defined. I can't figure out what's wrong. I think the environment...

How to determine the subnet mask and network interface card from remote SSH login?

linux,shell,ssh,network-programming,aix
In a separate question (link below), it was suggested that I obtain the network interface card number and subnet mask from a remote SSH login, rather than prompting the user for it. All I have is the IP address of my remote host. I need to obtain the subnet mask...

SNMP :snmpwalk response from NAS timeout issue

linux,network-programming,snmp,nas
I am new to Linux networking. I am trying to configure SNMP between a Linux pc <--> Switch <--> NAS(Buffalo TS500D). I have configured snmpd in linux pc and enabled SNMP in NAS. When I checked the query mesasage from linux pc using command $snmpwalk -Os -c MSTTeraStation -v 2c...

EC2 Multiple Simultaneous Network Requests With Python

python,amazon-web-services,network-programming
Can Amazon's EC2 instances make multiple, simultaneous network requests? I'm pinging a few different api's with the same query. I'm wondering if I break my api request loop into subprocesses (using python's subprocess) if I'm just creating a network que or am I actually splitting my bandwidth for each call?...

HTTP::Daemon and debug error codes

linux,perl,sockets,network-programming
How can I debug error codes when the daemon itself can not be initialized: my $d = HTTP::Daemon->new(LocalAddr=>$ae::Settings{ip}, LocalPort=>$ae::Settings{port}, ReuseAddr=>'1') || die "error"; What I would like is more specific error codes instead of a simple 'die'. For example if I can't bind to certain ports, etc....

How to determine the network bandwidth usage for a server call?

networking,network-programming
I would like to determine the network bandwidth usage when I make a call like below. https://example.com/logEvent?clientId=samsung+sm-t320&sessionId=2AA8A8E2050120C6-60000137C0001656&clientOs=4.4.2&clientVersion=33.0.0&appId=com.abc.app&accountId=f5370a7b-6356-4a0b-b139-9b42ad23e09c&issueId=1&code=ArticleDownloadStarted I am open to using some developer tools available as an extension to the browser or other standalone tools or a way of doing this programmatically in Java. Background: I am being told...

How to avoid adding a link between two nodes twice

network-programming,netlogo
I've made the following netlogo procedure that creates a network with a given number of nodes and undirected links between nodes: to setup ;; Here I created the nodes and sort them around a circle clear-all create-turtles number-of-nodes layout-circle turtles max-pxcor ;; Here I add the links let i 0...

Reference Path On Another Server on Network C#

c#,file,network-programming,server
I am having an issue trying to reference a drive\path on another on the same network as my application. string LocationPath = "\\servername\F$\FirstDirectory\SecondDirectory\filename.txt"; I would like to use streamreader to capture the contents of this file but can't seem to access it. This is how I reference the directory in...

how to connect to a NIC card or network adapter knowing its IP address?

delphi,network-programming,ip-address,windows-10
Say I have two NIC or adapter card on my system and also I found their IP address through the following code: procedure TForm4.RetrieveLocalAdapterInformation(strings: Tmemo); var pAdapterInfo, pTempAdapterInfo: PIP_ADAPTER_INFO; AdapterInfo: IP_ADAPTER_INFO; BufLen: DWORD; Status: DWORD; strMAC: String; i: Integer; begin strings.Clear; BufLen:= sizeof(AdapterInfo); pAdapterInfo:= @AdapterInfo; Status:= GetAdaptersInfo(nil, BufLen); pAdapterInfo:= AllocMem(BufLen);...

what's the best practice to design an error code of a method?

java,c++,network-programming
since I don't have many in practice programming experience, I wonder that how to design an error code of method/function. For example, in java there is a method - string foo(int arg1, string arg2), the method return a string that can be null and it difficult to find a special...

How to switch views in the handler of an NSURLSession Request

ios,swift,ios8,network-programming
I have a Login View Controller, and an Other View Controller. What I'd like to do is: when the user hits login, it sends their credentials to the remote server. The remote server returns a response indicating whether the credentials were good or not, and if they were good, the...

SSH connection problems in JSch

ssh,network-programming,server,jsch,public-key-exchange
I am trying to connect to a server using JSch. I get the "Negotiation fail" error. I checked the sshd_config file and got the following info: UsePAM yes PasswordAuthentication no Ciphers aes128-ctr,aes256-ctr,arcfour256,arcfour,aes128-cbc,aes256-cbc AllowTcpForwarding no PermitRootLogin no The rest of the scripts are commented out. As you see it doesn't mention...

Bash script to configure network interfaces

linux,bash,unix,network-programming,network-interface
I'm a network and OS student, and I have to make a script that does the following: It can be called with or without parameters. If called with parameters, it must recieve the name of a network interface (e.g: eth0) and a "name of a configuration profile". Well, I am...

Restricting Access to Rails App based on IP-Address

ruby-on-rails,ruby,network-programming
I want to make an application that will be accessible only from a specific network connection. More clearly, it will be a attendance application. Users can only check in from a specific network connection. If they are connected with other network, they can not able to check in. How can...

Given a path, how can i find out its host?

c#,windows,network-programming
How can I implement this function: GetHost("C:\MyFolder"); //Local GetHost("D:\MyFolder"); //Local GetHost("\\FileServer1\MyFolder"); //FileServer1 GetHost("Y:\MyFolder"); //FileServer1 GetHost("\\LocalSharedFolder\MyOtherFolder"); //Local GetHost("\\SpecialSharedFolder\YetAnotherFolder"); //FileServer2 Edit1: So far i've tried juggling DirectoryInfo, DriveInfo, ManagementClass...

WebSocket serverSocket.Accept() doesn't trigger

c#,websocket,network-programming
I am trying to send strings to a server using Synchronous WebSockets in a C# console application. The following code works flawlessly on 127.0.0.1 but doesn't work on any real server I tried. The result I get is that the client connects to the IP/Port and sends strings with no...

C++ Verifying Sent Packets on Real Time Network using SFML

c++,network-programming,sfml,fps
I am building a networkable program that transfers graphical changes on a 2d screen with SFML UDP libraries. I want to run close to all of the processing on the host server, and only send the graphic updates and command return values to the client. I want to make a...

Why is my networked Java code skipping the output on every other round?

java,network-programming,echo
I have a threaded java client/server pair, and it's behaving really strange . Here is the server side : public class sample_server { private static int port=4444, maxConnections=0; // Listen for incoming connections and handle them public static void main(String[] args) { int i=0; try{ ServerSocket listener = new ServerSocket(port);...

Sending files from client to server using sockets in C

c,network-programming
The program is supposed to send the contents of a file from the client side to an output file on the server side. However, my code is working for few files and not working for most of the files. For example if I try to copy content of a file...

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...

How to use QNetworkManager for REST api?

c++,qt,rest,network-programming
I would like to make a class for accessing data via REST API, for example: class MeteoStation{ int getLatestTemperature(); int getLatestPessure(); private: QNetworkManager nmng; } How could I implement this methods? Usually I was using something like: int MeteoStation::getLatestTemperature(){ ... QEventLoop eventLoop; connect(&m_nam,SIGNAL(finished(QNetworkReply*)),&eventLoop,SLOT(quit())); QNetworkReply *reply = m_nam.get( req ); eventLoop.exec();...

android.os.NetworkOnMainThreadException how to adapt this code that it runs in a seperate thread

java,android,multithreading,network-programming
I'm developing a software where a PC and a mobile talking to a server. When i run the code from the JAVA desktop app it gives me the following error android.os.NetworkOnMainThreadException I tried to implement my class as a thread but i think i did not get it right. it...

Self Signed Certificate: connection timeouts

sockets,google-chrome,tcp,network-programming
I have a web application (Apache 2.4 on Centos 7 server) that has limited user access and I am using Self Signed Certificate with Client Certificates (mutual authentication) for each user. Everything works great; users are authenticated successfully, Chrome shows green https in the address bar since I added certs...

Issue regarding accept() in socket server client programming in C (Linux)

c,linux,sockets,network-programming,client-server
I have written a server and client program using socket in C in Linux. Codes are given below: Server Code: #include<stdio.h> #include<string.h> //strlen #include<sys/socket.h> #include<arpa/inet.h> //inet_addr #include<unistd.h> //write int main(int argc , char *argv[]) { int socket_desc , client_sock , c , read_size; struct sockaddr_in server , client; char client_message[2000];...

Android volley Timeout Exception when using RequestFuture.get()

java,android,network-programming,android-volley,future
In my Fragment, i am trying to use TMDB's open movie DB to get details about "Now Playing" Movies. If i use RequestFuture.get(time, TimeUnit) method to execute this volley request i always get a timeout error. If i manually test the same Url in Safari, i get the results instantaneously....

Is it better to reuse connections, or renew them for sending data frequently?

sockets,tcp,network-programming
I have a TCP server application which listens for connections from clients that send "heartbeat" packets frequently in rather small intervals, around 20 seconds. There are a few hundred such clients, 1000 at most. It has previously been implemented (not by me) such that a new TCP connection is established...

select() VS “manual polling” on non-blocking socket

sockets,network-programming
I've a non-blocking socket used for writing operations (send). I would like to know if the select() is the only way to detect if: - the socket connect completed successfully when connect returns EINPROGRESS - the availability of socket for write operations when send return EWOULDBLOCK or EGAIN Is polling...

How to initialize WSAOVERLAPPED when using IOCP?

c++,sockets,winapi,network-programming,iocp
I am not sure how to initialize WSAOVERLAPPED when using IOCP. I don't think that I need to initialize it at all, I only set WSAOVERLAPPED.hEvent to NULL (not sure if this is necessary either). Is this code correct: // Send data char buffer[1024]; WSABUF wsaBuf; wsaBuf.buf = buffer; wsaBuf.len...

public suffix list: why isn't wordpress.com listed there?

wordpress,network-programming,public-suffix-list
sorry if this is a bit off-topic. I'm using guava which internally uses the public suffix list. How come blogspot.com is there while wordpress.com isn't? (and also etsy.com and many others...) I thought the purpose of this list is to help me detect that ihadanny.wordpress.com and highlyscalable.wordpress.com are not owned...

Regex match MAC Addresses (different delimiters, formatting, etc.) [closed]

python,regex,network-programming,mac-address,regex-lookarounds
I was trying to find a Python compatible Regex expression that would be best for matching MAC addresses, but exclude things that might be mistaken for them (e.g., SSH keys). Also, I'd like to match the different delimiters (e.g., -, :, or .), different formatting (e.g., *nix, Windows, Cisco), and...

Sending LinkedList of Objects through ObjectInputStream throws exceptions 'NotSerializableException' and 'StreamCorruptedException' [duplicate]

java,sockets,exception,linked-list,network-programming
This question already has an answer here: StreamCorruptedException: invalid type code: AC 2 answers I'am writing a simple copy of 'Space Invaders'. I want to add network feature, and atm I have problem with Writing/Reading data. So I have a LinkedList of (objects)Aliens and I want to send this...

check accessibility of all nodes in a network in java

java,networking,network-programming
I want to check all of nodes accessibility in a network using java. I have read This and This Questions and I have write my method by helping these questions, I have at least two tested Ips in my network which are accessible, one of them is 192.168.1.1 and another...

“Algorithm negotiation fail” error in JSch when trying to connect to Symantec NetBackup - grabing reports remotely

java,ssh,network-programming,server,jsch
I have been searching online and found similar posts but could not find a solution reading them. I am trying to connect to NetBackup servers using ssh from my computer and run a report and create graphs based on them. I am doing this using java and JSch library. The...

Connecting to Server on One Computer from another with TCP Listener/Sockets

c#,sockets,tcp,network-programming,server
I have a simple server I can run on one computer that a simple chat client can connect to. When I run the server on my local, I can connect to it fine from a client also on the local. The problem is that I can't seem to connect to...

How will a socket act when the data is sent faster than it can be processed?

sockets,networking,tcp,network-programming,flow-control
I am not quite clear some detail mechanisms of TCP and sockets. One client connects to a server through TCP, and sends data to server. What happens if the speed of sending is far greater than the speed of processing? For example, if the client sends 1MiB per second, but...

Bittorrent bitfield length

python,network-programming,bittorrent
I write BitTorrent client and right now I'm dealing with bitfield messages. The bitfield message looks like below: <len=0001+X><id=5><bitfield> The problem is that the len is always the same while the actual length of message is always different. Here's my python code: message = self.recv(4096) print(len(message)) #prints different numbers every...

EOFException: java.io.EOFException is thrown in Java client-server application

java,networking,network-programming
I've programmed the following client-server pair to set up a very simplified version of an IPSec-connection (Cryptography-related). The problem is, that on the second call to readObject(), i.e.: // Receive finished message from server finishedMessage = (BigInteger) inputStream.readObject(); I get a java.io.EOFException. It should be said, that on most runs...

The meaning of Java's DatagramChannel.write()

java,sockets,network-programming,udp
I recently found code using DatagramChannel.write(). The code only asked for host ip and port before it connected and then would allow sending (via DatagramChannel.write()). Being new to network programming, it seemed odd that it wouldn't request the destination IP/port. Why not? Oracle's documentation states This method may only be...

irc server response to JOIN comment

python,join,network-programming,irc,hexchat
I'm new with writing an IRC sever. I get Log from joining the channel in freenode connection . The server response to : /JOIN #h was :[email protected] JOIN #h * :realname and test was my nickname. Does anyone know that , what is exactly 151.232.114.48 ?...

How do I send the current timestamp as a String , over a networked connection(using Java)?

java,network-programming
I need to code a simple Java client/server pair, where the server sends the timestamp to any N number of clients. Here my code thus far, for the Server side (client is just the same type of code) : import java.sql.Timestamp; import java.util.Date; import java.net.*; import java.io.*; public class EchoServer...

Golang UDP Server only recieving locally sent packets

linux,go,network-programming,udp
I've written a UDP Server in Go(listens on port 666), and it seems to be only receiving packets that were sent locally. To confirm traffic, I have been using: sudo tcpdump -n udp dst port 666 My(abbreviated) server code: import "net" func startServer() { // Bind the port. ServerAddr, err...

Multi-client chat program, broadcasting chat to all clients?

java,multithreading,network-programming,server,tcp-ip
I'm trying to make a very simple chat program that can accommodate multiple clients. I have a multi-threaded server and can connect multiple clients to it, but the server only communicates with a single client (as it should, each client is on its own thread) I need help getting the...

Read libcap file with specific endianness

c,network-programming,endianness,tcpdump
I wrote a c-lang program to read a .pcap file.What fogs me is that the data I read was with a different endianness as to WireShark. I'm working on X86 ach, as I can see, it's LittleEndian. So, can I read the .pcap file with BigEndian? How? Code fragments: /*...

Socket programming - why do we not convert sin_family to network order?

c,sockets,network-programming
Below is an example of a valid socket creation (in C): // Construct local address structure struct sockaddr_in servAddr; // Local address memset(&servAddr, 0, sizeof(servAddr)); // Zero out structure servAddr.sin_family = AF_INET; // IPv4 address family servAddr.sin_addr.s_addr = htonl(INADDR_ANY); // Any incoming interface servAddr.sin_port = htons(servPort); // Local port We...

Push data to client, how to handle slow clients?

sockets,network-programming,client-server
In a push model, where server pushes data to clients, how does one handle clients with low or variable bandwidth? For example i receive data from a producer and send the data to my clients (push). What if one of my clients decides to download a linux iso, the available...

OSX internet via TimeCapsule - wireless works, wired doesnt

osx,network-programming,connection
I have a strange problem. My ISP delivers internet over cable. There is a cable modem/router (F-connect in) at the entry-point and from there a wired connection to my TimeCapsule. Everything is fine. I have a OSX laptop and a OSX Mac mini. On both I want to connect to...

Last few chars in a string sent over socket sometimes missing in Java network program

java,string,sockets,network-programming
Right now, I'm trying to write a GUI based Java tic-tac-toe game that functions over a network connection. It essentially works at this point, however I have an intermittent error in which several chars sent over the network connection are lost during gameplay. One case looked like this, when println...

multiple clients cannot listen and write at the same time

python,network-programming,client-server,client
I'm writing a very basic chat room in python. Clients connect and any message from a client is relayed to all clients. The problem I'm having is getting the client to listen and send messages at the same time. It seems to only do either one. I've set up a...

Create batch script to edit host file by network connection

windows,batch-file,cmd,network-programming
I want to use this batch script to add new entries into my host file automatically by using windows batch. I want to edit host file only when i m in office. I want to say like that: if(network name=='OfficeWifi') do changes... @echo off set hostspath=%windir%\System32\drivers\etc\hosts // if(network name=='OfficeWifi') echo...

How do i reset the system cache of WLAN info?

c#,network-programming
I am trying to write a WLAN fingerprinting program using NativeWifi in C#. To do this i run a loop to get the wlan information many times and then later use matlab to average / analyze the data. The problem is that i get all the same values, even as...

How to create an ONVIF compliant interface using PiCam without third party codes?

network-programming,raspberry-pi,raspbian,onvif
I was looking through a lot of questions and answers about ONVIF compliant solutions for raspberry pi, but most of them provide incomplete solutions to my problem. I am looking for a way to make the Raspberry Pi Camera (Not an USB camera) into an ONVIF compliant camera which streams...

Extract content of file and attach to a socket & send Socket Programming

c,sockets,network-programming
What's the proper/most simple way to treat the contents of file as a data stream (User chooses buffer size) and send it as a UDP packet through a socket? And then record the number of bytes sent? What's the correct way to approach this? Current progress of my UDP Client....

NTML authentication on Apache 2.4 with mod_authnz_sspi

apache,authentication,network-programming,ntlm
I've difficulties reaching a file on one Apache web server from another web server. Or even from the same web server. First let me give you the specfications of the two servers involved. Server 1: Windows Server 2003 Apache 2.2 32bit PHP 5.2.10 Server 2: Windows Server 2012 R2 Standard...

Where is a delay in an HTTP POST coming from?

c++,performance,curl,network-programming,cpp-netlib
I am developing a web service on Ubuntu 14.04 in C++ using cpp-netlib in asynchronous mode. The service needs to respond to data sent over HTTP POST in the message body. I am observing poor performance when receiving input larger than 1K, and I want to fix that. If the...

Check every computer in network if specific service runs

c#,windows,powershell,network-programming
For a software update, I need to know if a specific service runs on all computers. And if not, I need to start this service on the missing devices. Is there a possibility to realize this in C# or PowerShell?...

select() returning 1 even in case process on remote host bound to a given port is killed

c,sockets,network-programming
I have written a program using non-blocking connect() and select() combination to check the connection to a remote host at a particular port. select() has some timeout value also, in my case 2.5s. I am testing the program to connect to a process running the SMTP service on the remote...

Java UDP datagram packet - slicing data to suit buffer size

java,sockets,network-programming,udp,client-server
in Java, UDP datagram packets uses a fixed size of byte array to send and receive streams through the network. if the data I want to send is bigger than the buffer how to slice the data to suit the datagram packet ? if data is sliced at the client...

Timeout after 1024 connections from different virtual IPs

python,linux,sockets,tcp,network-programming
I have a problem I have struggled with some time now without solving it. I am implementing a traffic generator which has a client and a server side. The client side simulates devices with unique IP-addresses. These IPs are added as a virtual interface on the client which the simulated...

Creating key:attribute pairs in networkx for Python

python,network-programming
I am working on creating a graph method for analyzing images using pixels as nodes in Python. Using networkx as graph support(documentation here: https://networkx.github.io/documentation/latest/index.html ) Take this as an example: new=np.arange(256) g=nx.Graph() for x in new: g.add_node(x) h=g.order() print h As expected, 256 nodes will be created. Now, I would...

Non-OS Specific FD(File Descriptor) for C/C++

c++,design-patterns,asynchronous,file-io,network-programming
Linux is also treated as a file, a network socket. but, Windows is not. and common files and network sockets treated as "FD". if the code should not rely on the operating system, how should write? i think it like below.. #ifndef INVALID_SOCKET #define INVALID_SOCKET (-1) #endif class Descriptor {...

How to download a file without browser and open/save dialog batch maybe?

windows,batch-file,command-line,vbscript,network-programming
I'm asking that what other method to download a file from internet other than browsers and other softwares, i think is possible with CMD(command line), batch script ? To be more exactly to use a windows (let say 7) component to download a file without a dialog like vbs, hta,...

I need some help understanding this C# socket code

c#,sockets,network-programming
I'm currently trying to learn network connections with C#, and I went right ahead and started with sockets. I read up some guides now, and I found a somewhat good and understandable guide, but now they supply me with this code for a serversocket, and I have some struggle understanding...

How to implement an ethernet modem

c,network-programming,ethernet,raw-ethernet
Okay, what I want to do, as a training exercise, is to implement something like this client --ethernet--> Modem1 --GPIO--> Modem2 --ethernet--> My Home Router Where the client connects to Modem1 using an ethernet cable. Modem1 is a Raberry PI, converting the signal and relaying it via the GPIO Modem2...

Assign network response sooner

ios,network-programming
I'm developing an app that relies on a web service backend. I have a separate class API to handle all network activities and send the data to the relevant view controllers. I have a NSURLSession.dataTaskWithRequest() which sends my data via POST to my API and returns a response. I figured...

byte to int type conversion network application

java,c,casting,network-programming,type-conversion
I'm sending from my android phone integer as byte with the following code(I put only the needed chunks): private byte[] intToByteArray ( final int i ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(bos); dos.writeInt(i); dos.flush(); return bos.toByteArray(); } //thread sender data = new byte[16];...

Pass connected SSL Socket to another Process

python,network-programming,openssl,m2crypto
I am struggling to find a mechanism to send a request to the target server and when the socket has data to be read, pass the socket to another process for getting the data out. I came so far using epoll on Linux, to implement it to the point that...

Get network interfaces on remote machine

java,network-programming
I know in java we can do NetworkInterface.getNetworkInterfaces() to get all available network interfaces on local machine. Can we do similar thing where I can pass host name to get the NICs(with IPs) which are up and running?

GNetLib - java.net.BindException: Cannot assign requested address: JVM_Bind

java,network-programming
I'm testing my server using GNetLib for my networking on my computer. Whenever I use the IP of my network, it won't let my bind. GNetServer netserver = new GNetServer(ServerConstants.HOST, ServerConstants.PORT); netserver.addEventListener(new ServerEventListener() { //random stuff not related to problem }); netserver.bind(); My host is "76.5.43.21" // Not posting my...

Java UDP Connection

java,sockets,netbeans,network-programming,udp
I'm using Netbeans IDE trying to make a UDP connection between client and server, it's a simple program that UDPClient send a String to UDPServer and the server capitalize the string and sends it back to the client.I made the client side and server side in a separated projects. my...

C# WCF impersonation does not work with Directory.Exists of network direcotory

c#,wcf,network-programming,impersonation,credentials
I have WCF service, that checks if directory exists with Directory.Exists method (this directory is locate on network server). After that it does some random stuff. This service uses clients impersonation. I've tested it and with WindowsIdentity.GetCurrent().Name it shows the right user name. My client application is simple console application....

Mutex Across Threads?

c#,multithreading,callback,network-programming,mutex
So, I am getting an exception with the code below. I have put the exception details with it, but I believe it is caused by the fact that a different thread releases the lock then the one that starts the lock. I want to do this to potentially allow my...

How to change port that HSQLDB server listens on

java,network-programming,port,hsqldb
I am starting a HSQLDB server programmatically, however I am getting port conflicts when I try an run the HSQLDB server in conjunction with a web application that I am developing. I get the following error on the webapp side java.util.concurrent.ExecutionException: java.net.BindException: Address already in use: JVM_Bind & I get...

Does listen() backlog affect established TCP connections?

sockets,tcp,network-programming
Would it be naive to create a TCP socket with a listen backlog set to minimum as a way of rate limiting new incoming connections? The server workload in question doesn't expect many new connections at any time but spends a lot of time servicing long open persistent connections. It...

Bind in TCP/UDP Sockets

c,sockets,tcp,network-programming,udp
Bind function is used to assign a name (a sockaddr struct) to a socket descriptor. Why is it required for TCP server but not TCP client ? And why it is required for bot UDP Client and server? I have also written correctly working code without using bind() in UDP...

How to exit a blocking recv() call?

c++,sockets,winapi,network-programming,winsock
Based on this question, when you call closesocket() on a socket that recv() is already using, then an RST packet will be sent to the other side instead of performing a graceful disconnection (4-way handshake). But I wish to perform a graceful disconnection, so I need to exit recv() before...

UDP recvfrom data not displaying properly

c,sockets,network-programming
Html file has the following content Helloworld.html Hello World Testing Echo Server Output from Server Client Code //Pack contents into UDP packet and send while(1) { //Check for Validity of File readSize = fread(buffer, 1, bufferSize, currentFile); if (readSize <= 0) { if (ferror(currentFile) != 0) { fprintf(stderr, "Unable to...