Menu
  • HOME
  • TAGS

Bind in TCP/UDP Sockets

c,sockets,tcp,network-programming,udp

Binding is only a required, if there is no other way for the computer to know which program to send the packets to. For connection less programs this is only the receiving end. Please have a look at socket connect() vs bind() this post. There a much better job of...

How to switch views in the handler of an NSURLSession Request

ios,swift,ios8,network-programming

If it's crashing, you should share the details the crash in order to identify why. Likely problems include that it didn't find a segue of that identifier as the "storyboard id" from the current view controller to the next scene. But it's impossible to say without details on the precise...

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

c++,design-patterns,asynchronous,file-io,network-programming

You cannot do that (getting a non-OS specific file descriptor, or portably dealing with network sockets without any OS support). File descriptors & network sockets are an Operating System specific thing (or in the POSIX standard). The C standard library (from C99 or C11 standards) does not know them. fileno(3)...

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

java,multithreading,network-programming,server,tcp-ip

You have no way of accessing all of the ServerThreads you create. What you need to do is group them all together in a collection, such as an ArrayList. Or even better, a HashMap, if you would ever want to expand your application to allow private messaging, you would need...

reach local WildFly server over LAN

java,java-ee,network-programming,wildfly

The configuration looks fine, I assume that there is some other Windows /network configuration besides the firewall setting preventing your access. Try telnet hostname port from your client to your server to check if port is accessible (see this SU answer)....

Create batch script to edit host file by network connection

windows,batch-file,cmd,network-programming

You can get the network name (SSID) of the currently connected wireless network using the following batch file: for /f "tokens=3" %%a in ('netsh wlan show interface ^| findstr /r "^....SSID"' ) do @echo %%a So your batch file would look like: @echo off set hostspath=%windir%\System32\drivers\etc\hosts for /f "tokens=3" %%a...

Timing packets on a traffic server

python,unix,networking,network-programming,server

I always found it easier to utilize a switch's 'port mirror' to copy all data in and out of the proxy's switchport to a separate port that connects to a dedicated capture box, which does the tcpdump work for you. If your switch(es) have this capability, it reduces the load...

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

java,network-programming

String.valueOf(new Date().getTime()) ...

Android volley Timeout Exception when using RequestFuture.get()

java,android,network-programming,android-volley,future

Sad that no-one could help answer this question but i managed to solve this issue like below: The timeout will happen to the RequestFuture.get() if it is on the same thread as the UI thread. I have changed the mechanism of the request so that the request is done on...

Timeout after 1024 connections from different virtual IPs

python,linux,sockets,tcp,network-programming

Interesting question, so I did a test with my VM's. I was able to find that, you are hitting limit on ARP neighbour entries # sysctl -a|grep net.ipv4.neigh.default.gc_thresh net.ipv4.neigh.default.gc_thresh1 = 128 net.ipv4.neigh.default.gc_thresh2 = 512 net.ipv4.neigh.default.gc_thresh3 = 1024 Above are default values and when your 1024th connection fills up this table,...

Java read bytes from Socket on Linux

linux,windows,sockets,network-programming,raspberry-pi

InputStream input = client.getInputStream(); BufferedReader in = new BufferedReader(new InputStreamReader(input)); Your problem is here. You can't use multiple inputs on a socket when one or more of them is buffered. The buffered input stream/reader will read-ahead and 'steal' data from the other stream. You need to change your protocol so...

Pass connected SSL Socket to another Process

python,network-programming,openssl,m2crypto

The only way you can do this is by cloning the full user space part of the SSL socket, which is spread over multiple internal data structures. Since you don't have access to all the structures from python you can only do this by cloning the process, i.e. use fork....

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

delphi,network-programming,ip-address,windows-10

It sounds as though the library that you use requires elevated rights. Nothing significant has changed in Windows 10 regarding UAC. If your program is running elevated it will succeed. It fails when it is not elevated. So your problem would appear to be that you are failing to execute...

Raw HTTP1.1 request implementaion in Java not getting terminated

java,network-programming

HTTP keepalive is on by default in 1.1. So the response isn't terminated by end of stream: it is terminated by the Content-length or the chunking if used. See RFC 2616. If you're implementing HTTP you need to know it all....

How do i reset the system cache of WLAN info?

c#,network-programming

Internally, netsh is powered by this API. What this means, is that calling netsh wlan show networks mode=bssid just returns the cache of the networks that showed up during the last scan. This is what you've discovered. This means that in order to refresh this cache, you need to trigger...

Sending files from client to server using sockets in C

c,network-programming

The issue is that both transmission and reception loop are bugged! I've modified them in a way that the codes run better, but I think there's a lot to modify to have a solid code! Client: #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #include <string.h> #include <stdlib.h>...

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

c,linux,sockets,network-programming,client-server

@EJP explained it well, if you want to fix you issue, use this code: Client: #include<stdio.h> //printf #include<string.h> //strlen #include<sys/socket.h> //socket #include<arpa/inet.h> //inet_addr int main(int argc , char *argv[]) { char buf[1]; int sock; struct sockaddr_in server; char message[1000] , server_reply[2000]; int ret; //Create socket sock = socket(AF_INET , SOCK_STREAM...

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

bash,shell,unix,network-programming,network-interface

This is how would I handle the problem: #!/bin/bash if [[ $# != 2 ]]; then echo "ERROR: Usage is ./$0 eth-name profile-name" exit 1 fi eth=$1 profile=$2 if [[ ! -f "$profile.txt" ]]; then echo "ERROR: $profile.txt file not found!" exit 1 fi # TODO: validate $eth ip=$(awk '{print...

I need some help understanding this C# socket code

c#,sockets,network-programming

Looks like a mixed solution for me. Typically TcpListener listener = new TcpListener(8888) awaits for the connection on given port. Then, when it accepts the connection from client, it establishes connection on different socket Socket socket = listener.AcceptSocket() so that listening port remains awaiting for other connections (another clients). Then,...

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

c,network-programming,ip,qos

The DSCP field has taken the place of the ToS field: these are just two names for the very same field in the IP header. If the sender put a DSCP value into the field, then it's just fine to access it using the ToS field. Note however that whether...

C# TCP Connection to Siemens S7 PLC - Network Newbie

c#,network-programming,port,plc

I know this is an old thread, but now there is a better tool than s7netplus. Take a look to: Snap7 - Step7 Ethernet Communication Suite Excellent tool LGPL3 by Davide Nardella. Overview Snap7 is an open source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively with Siemens S7...

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

c++,network-programming,sfml,fps

If you're going to simulate TCP with UDP, why not use TCP? If you're adamant on using UDP as performance is maybe critical (and even if you think performance is critical, TCP will probably do the job), your client should send it's command/changes/data and only react on received data and...

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

c++,windows,multithreading,sockets,network-programming

Your code must not assume that both APCs will be called before SleepEx() returns. Conversely, it must not assume that a pending APC will not be called simply because the specified wait period has expired. The only behaviour that you can rely upon is that if one or more APCs...

Implementing chat client following Beej's guide to network programming

c,sockets,network-programming,posix

recv(2) is a read operation, so sockfd should go in readfds instead of writefds. (Where's STDIN from by the way? On POSIX systems you can use STDIN_FILENO.) You already said this was simple test code (which is likely to work as expected in practice), but just in case you're not...

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

java,sockets,exception,linked-list,network-programming

Most likely your Alien class contains an instance reference to an instance of the nonserializable ToolkitImage class. You may need to refactor your code so the Alien class doesn't contain such an instance reference, for exaample by making that reference a static constant. Alternatively, you can write custom writeObject(), readObject(),...

Network Service Discovery on Windows Phone

c#,network-programming,udp,windows-phone-8.1

Don't forget to set a valid port number and receive multicast data asynchronously This sample might help you ...

Mutex Across Threads?

c#,multithreading,callback,network-programming,mutex

Considering this - I want to do this to potentially allow my main thread to continue while the writes queue up and occur. First and foremost, I want to know if there IS a way this can be done? I don't think you need a mutex for that. Are you...

Best way to handle multiple sockets in Qt server application?

c++,qt,sockets,network-programming

You can identify the socket, which emitted readyRead() singnal by following code in the slot: QTcpSocket* socket = qobject_cast< QTcpSocket* >(sender()); ...and read the data by socket->readAll(). sender() returns the pointer to QObject, which emit the signal.

Reference Path On Another Server on Network C#

c#,file,network-programming,server

You need to escape the backslash: string LocationPath = "\\\\servername\\F$\\FirstDirectory\\SecondDirectory\\filename.txt"; Or use a verbatim string: string LocationPath = @"\\servername\F$\FirstDirectory\SecondDirectory\filename.txt"; ...

How to implement an ethernet modem

c,network-programming,ethernet,raw-ethernet

I'd venture to say you might be able to write some sort of custom GPIO intermediate layer. Read Ethernet->Encapsulate->Write GPIO->|->Read GPIO->Decapsulate->Write Ethernet (and vice versa) The problem then becomes: How can both modems act as "Ethernet proxies"? Modem1 acts as a proxy for the router. Modem2 acts as a proxy...

How to avoid adding a link between two nodes twice

network-programming,netlogo

link-neighbor? will tell you that. It's a turtle reporter and it takes one argument; the turtle that you are want to know if it is connected to. So: ask n-of number-of-links turtles [create-link-with one-of other turtles with [not link-neighbor? myself]] will do the trick. Keep in mind that this will...

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

java,network-programming

You can only use an IP address that is local to the current host. You can't use an IP address that lives on the other side of a modem, router, etc. I would just bind to 0.0.0.0, which is an InetAddress of null in Java: then you're listening at any...

How to assert a spawn is “filled”?

unity3d,network-programming,spawn,photon

You can add those two possible spawn spots as empty game objects. Then I'd make a boolean array and set its states to true or false depending on if the spot is occupied. The spots aren't directly stored in this array so you should make another array. In C# this...

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

c#,sockets,tcp,network-programming,server

The server is creating a connection in a similar fashion, on the same port, but on the localhost IP 127.0.0.1, for reference. The server is bound to the loop-back address. Hence when you connect from client running from same machine as server, connect is successful. If the client is...

Multicast listening and interface IP address change

c,linux,network-programming,multicast

The Linux kernel appears to be tracking the interface based on the interface identifier rather than the interface IP address. From a couple of experiments, it looks like your application won't need to have any special handling Experiment 1: Host Receiving Here's an experiment I put together with Ubuntu to...

HTTP::Daemon and debug error codes

linux,perl,sockets,network-programming

If I'm not root and I run this against a privileged ( < 1024 ) port or against a higher port that is already in use: #!perl # HTTP_daemon.pl use HTTP::Daemon; use warnings; my $d = HTTP::Daemon->new(LocalAddr=>"127.0.0.1", LocalPort=>"88", ReuseAddr=>'1') || die "$!"; I get: Permission denied at HTTP_daemon.pl line 4....

Bittorrent bitfield length

python,network-programming,bittorrent

Disclaimler: I know nothing about python network APIs in general and what recv() does specifically. TCP can be thought of as two independent, infinite streams of bytes, it's not separated into individual messages like UDP is. You are simply reading whatever is currently available to your network layer into a...

Refactor an IO recursive loop into a monad folding in Haskell

sockets,haskell,network-programming,io-monad

The idiomatic way to repeat the same action over and over again forever is forever serverLoop :: Socket -> IO () serverLoop sock = forever $ do (conn, _) <- accept sock forkIO $ handleConn conn ...

Getting started with network programming in Qt [closed]

c++,qt,network-programming,boost-asio

Trying to answer your first question, it depends on which platforms are you targeting (Windows, Linux, OSX...). You could use native OS socket api (bsd sockets or winsock) but Qt provides very good abstractions for these so for the sake of simplicity I would stick with it. I'm unfamiliar with...

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

java,android,multithreading,network-programming

You can find detailed description about threads at the following link: http://developer.android.com/guide/components/processes-and-threads.html#Threads You could do something like this new Thread(new Runnable() { public void run() { ServerAccessMobile serverAccessMobile = new ServerAccessMobile(); ArrayList <String> dataFromServer = **serverAccessMobile.getDataFromServer()**; ArrayList <String> dataToSend = ..... serverAccessMobile.setDataOServer(dataToSend); } }).start(); If you want to update the...

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

c++,sockets,network-programming,udp,sfml

You should read on the subject to see how it really works, like How do the protocols of real time strategy games such as Starcraft and Age of Empires look?. Asking the same question on SO might not be the way to go, as your question is too broad and...

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

network-programming,urllib2,urllib,urlopen,urllib3

Solved the problem when I look in to urllib literally. Actually what I need is urllib2 but because of I'm using python3.4 I souldn't import urllib it causes python use urllib part not urllib2. After importing urlib.request only and writing the url part as http://192.168.1.2 instead of 192.168.1.2 it works...

How to initialize WSAOVERLAPPED when using IOCP?

c++,sockets,winapi,network-programming,iocp

memset(&wsaOverlapped, 0, sizeof(wsaOverlapped)); Or explicitly set all values to zero....

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

java,network-programming,echo

PrintStream out = new PrintStream(server.getOutputStream()); You need the autoflush parameter here too, just as in the client where you construct the PrintWriter. Or else call flush() after every println() in the server, if you can be bothered....

Java UDP Connection

java,sockets,netbeans,network-programming,udp

You haven't specified any listening port in your server so the server listen on a random available port. Try with on server side DatagramSocket socket = new DatagramSocket(9876); ...

Restricting Access to Rails App based on IP-Address

ruby-on-rails,ruby,network-programming

In your ApplicationController add this: before_filter :block_foreign_hosts def whitelisted?(ip) return true if [123.43.65.1, 123.43.65.77].include?(ip) false end def block_foreign_hosts return false if whitelisted?(request.remote_ip) redirect_to "https://www.google.com" unless request.remote_ip.start_with?("123.456.789") end Of cause you have to replace the IP-Network I used in this example with the one you want to have access....

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

python,regex,network-programming,mac-address,regex-lookarounds

Here's what I eventually came up with. I'll try to outline the details below in the section titled notes. I intentionally left in three redundant/unnecessary non-capturing groups, but this helps delimit the code for each of the three paths. I'd greatly appreciate your feedback. Thanks. \b(?:(?<![-:\.])(?:(?:[0-9A-Fa-f]{2}(?=([-:\.]))(?:\1[0-9A-Fa-f]{2}){5})|(?:[0-9A-Fa-f]{4}(?=([-:\.]))(?:\2[0-9A-Fa-f]{4}){2}))(?![-:\.])|(?:[0-9A-Fa-f]{12}))\b Debuggex Demo Notes: I...

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

algorithm,network-programming,computer-science,dijkstra

If there are two entries with the same lowest cost, you can choose either - it doesn't matter. For example, if your tentative list looks like this: 10 4 9 7 7 3 2 11 5 2 and you were finding the minimum cost by using a sorted list, it...

Waiting to return main block until its encapsulated children are finished

swift,rest,asynchronous,network-programming

To trigger a block of code upon the completion of a series of asynchronous tasks, we generally use "dispatch groups." So create a dispatch group, "enter" the group before every request, "leave"'in every completion block, and then create a dispatch "notify" block that will be called when all of the...

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

java,c++,network-programming

First, if it is an error, use Exception, RuntimeException for the ones that are unexpected like a/0, and checked exception otherwise. Second, you may use a wrapper. For example, class SomeWrapper{ boolean isSuccess; String value; } Then the method can be SomeWrapper foo(...)...

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

java,ssh,network-programming,server,jsch

After doing a lot of research, I figured that to be able to have an SSH connection with Netbackup, you have to create a local user with access to bash shell, then allow root access to this user, since the netbackup commnands require you to be a superuser. Then, you...

How to use QNetworkManager for REST api?

c++,qt,rest,network-programming

I've resolved my problem using QCoreApplication::processEvents(). The response is there within ms and I'm able to implement functionality close to libcurl. QNetworkRequest req(url); QScopedPointer<QNetworkReply> reply(nam.get(req)); QTime timeout= QTime::currentTime().addSecs(10); while( QTime::currentTime() < timeout && !reply->isFinished()){ QCoreApplication::processEvents(QEventLoop::AllEvents, 100); } if (reply->error() != QNetworkReply::NoError) { qDebug() << "Failure" <<reply->errorString(); }...

Self Signed Certificate: connection timeouts

sockets,google-chrome,tcp,network-programming

It is all about Chrome. Returned error is ERR_CONNECTION_CLOSED. I even checked chrome://net-internals logs and it complains about SSL HANDSHAKE and CLIENT CERTIFICATE even I don't get the entire problem but understand that Chrome is not OK with Client Certs. Anyway, it doesn't happen in Internet Explorer, so it is...

Thread blocked indefinitely in an MVar operation

haskell,concurrency,network-programming

Three days later and its solved: Was actually unrelated to either the networking or concurrency code, and infact caused by my incorrect re-implementation of Yampas dpSwitch in Netwire. Corrected code posted below for anyone wishing to implement this function: dpSwitch :: (Monoid e, Applicative m, Monad m, T.Traversable col) =>...

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

sockets,tcp,network-programming

It depends on the amount of memory you have, of the latency of the connection and of the frequency of the heartbeat what the best options is: Each TCP connection needs 1xRTT time to setup, so creating a new connection each time is costly in terms of time but not...

QTcpSocket not emit any error or connected signals

c++,qt,network-programming,signals,qtcpsocket

You do not have a QApplication instance and thus no event loop which does all the event / signal&slot handling. So you at least need a QCoreApplication instance like this in main.cpp: int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Client client; client.connectToServer(); return a.exec(); } ...

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

sockets,networking,tcp,network-programming,flow-control

What happens if the speed of sending is far greater than the speed of processing? For example, if the client sends 1 MiB per second, but the server can only process 1 KiB per second … If the sender is in blocking mode, it will block if it gets...

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

c,sockets,network-programming

Try something like this: #include <stdlib.h> #include <stdio.h> #include <sys/socket.h> #include <netdb.h> #define PROTOPORT 33455 //Default Port Number #define BUFSIZE 1024 //Default Buffer Size int main(int argc, char *argv[]) { char *dHost; //Pointer to Destination IP Address int port; //Integer to hold Port Number char *host; //Pointer to Host IP...

How to change port that HSQLDB server listens on

java,network-programming,port,hsqldb

If you change the default port on the server, you need to specify the port in the connection URL: jdbc:hsqldb:hsql://localhost:9137/webappdb ...

How to exit a blocking recv() call?

c++,sockets,winapi,network-programming,winsock

You can shutdown() the socket for input. The recv() will unblock and return zero and everybody will be happy.

OSX internet via TimeCapsule - wireless works, wired doesnt

osx,network-programming,connection

• Try giving it a static IP • Change the cord • Delete the network then retry • Plug it into another network

Check every computer in network if specific service runs

c#,windows,powershell,network-programming

I ended up with a mix of all suggestions here and wrote a powershell script. Any improvements are much appreciated. $strFilter = "computer" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.SearchScope = "Subtree" $objSearcher.PageSize = 1000 $objSearcher.Filter = "(objectCategory=$strFilter)" $colResults = $objSearcher.FindAll() $counter = 0 foreach...

Read libcap file with specific endianness

c,network-programming,endianness,tcpdump

So, can I read the .pcap file with BigEndian? Yes. How? use libpcap/WinPcap, rather than writing your own code to read it, as libpcap/WinPcap handles byte-order issues for you; look at the magic number to determine whether the file is in the same byte order as the host reading...

check accessibility of all nodes in a network in java

java,networking,network-programming

The problem is that .isReachable() is not reliable. Its implementation is totally OS dependent! Let's take Linux as an example; this method uses the echo TCP service (port 7). Do you actually know of a server which has even that running today? I don't. It cannot use ping; look at...

WebSocket serverSocket.Accept() doesn't trigger

c#,websocket,network-programming

The server code must run on the machine that you want to connect to. That would be the machine that has IP 37.187.143.226. So either run everything locally and use target IP "localhost" or run the server on that other box and use the 37 IP. Also be aware that...

irc server response to JOIN comment

python,join,network-programming,irc,hexchat

151.232.114.48 is server address that you are trying to connect.

Java UDP datagram packet - slicing data to suit buffer size

java,sockets,network-programming,udp,client-server

Here is what I would do: Choose a maximum datagram size N you will send - 548 for example. You could try larger values up to 65535. Split the data into chunks of size N - 6. In each chunk, use 2 bytes for the datagram number and 2 bytes...

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

scala,network-programming,apache-spark,graph-algorithm,spark-graphx

I think you want to use GraphOps.collectNeighbors instead of either mapReduceTriplets or aggregateMessages. collectNeighbors will give you an RDD with, for every VertexId in your graph, the connected nodes as an array. Just reduce the Array based on your needs. Something like: val countsRdd = graph.collectNeighbors(EdgeDirection.Either) .join(graph.vertices) .map{ case (vid,t)...

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

windows,batch-file,command-line,vbscript,network-programming

Try this sample in vbscript : Option Explicit Dim URL,ws,fso,Srcimage,Temp,PathOutPutHTML,fhta,stRep,stFichier,oShell,oFolder,oFichier,Dimensions Dim arrSize,intLength,intHorizontalSize,intVerticalSize,Tab URL = "http://www.animatedimages.org/data/media/902/animated-tunisia-flag-image-0023.gif" Set ws = CreateObject("wscript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Temp = WS.ExpandEnvironmentStrings("%Temp%") PathOutPutHTML = Temp & "\image.hta" Set fhta = fso.OpenTextFile(PathOutPutHTML,2,True) stRep = Temp...

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

c,sockets,network-programming

I was able to accomplish by using another connect() after select() function call. Posting the code snippet error = connect(soc, (struct sockaddr *)serveraddr, sizeof(struct sockaddr)) ; if(error == 0){ DIAGC("vsrserv", 1, "Returning while connect is 0"); return 0; } if(errno != EINPROGRESS) return -1; int retVal = select (soc+1, &writeFD,...

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

wordpress,network-programming,public-suffix-list

I'm guessing this is just because Wordpress hasn't submitted wordpress.com to the list as a public suffix.

NTML authentication on Apache 2.4 with mod_authnz_sspi

apache,authentication,network-programming,ntlm

The behavior of the Apache server was absolutely correct, the function get_headers() didn't send a proper authentication so the server responded with HTTP code 401. The reason that it works on the old server can be found in the httpd.conf. There I defined the SSPI options for every single subdirectory...

Where is a delay in an HTTP POST coming from?

c++,performance,curl,network-programming,cpp-netlib

Problem solved, thanks to debugging and diagnostic techniques suggested by @jxh. Adding --trace - --trace-time to the curl command revealed that curl was spending that mysterious second waiting for the server to return a 100 Continue response before it sent the rest of the request: 01:31:44.043611 == Info: Connected to...

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

c#,windows,network-programming

GetDriveType can tell me if the disk is local or not in case of "Y://". WNetGetConnection can point me the network path for it, on the case of \\LocaSharedFolder, where I can extract its host name...

SSH connection problems in JSch

ssh,network-programming,server,jsch,public-key-exchange

I found the issue, it turns out that I had to download the Java Cryptography Extension (JCE) and replace the files with the ones that exist in the security folder in the following path: C:\Program Files\Java\jre6\lib\security\ Hope this will help whoever has the same issue....

byte to int type conversion network application

java,c,casting,network-programming,type-conversion

You have some possible signedness confusion. Consider your byteToInt() function: int byteToInt(char* bytes) { int ch1 = bytes[0]; int ch2 = bytes[1]; int ch3 = bytes[2]; int ch4 = bytes[3]; if ((ch1 | ch2 | ch3 | ch4) < 0) WPRINT_APP_INFO ( ("boh\r\n")); return ((ch1 << 24) + (ch2 <<...

Push data to client, how to handle slow clients?

sockets,network-programming,client-server

Now when my producers produces data and the server pushes it to the client, all clients will have to wait until all clients have downloaded the data. The above shouldn't be the case -- your clients should be able to download asynchronously from each other, with each client maintaining...

Bash script to configure network interfaces

linux,bash,unix,network-programming,network-interface

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 route add default gw 192.168.1.1 eth0 export http_proxy='http://ip:port/'...

Golang UDP Server only recieving locally sent packets

linux,go,network-programming,udp

It's doing what you told it to do: listen at 127.0.0.1. If you want it to listen at all interfaces, you have to specify 0.0.0.0. Don't ask me how that's done in Go....

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

c,sockets,network-programming

sin_family isn't sent over the network, so there's no need to use network byte order. It's a local flag for your operating system only. It indicates the polymorphic type of the struct sockaddr * pointer, because IPv4 isn't the only format. An AF_UNIX address doesn't get IP address and port...

uploading image in swift with multiple parameters

ios,swift,network-programming

You cannot post binary data in a application/x-www-form-urlencoded request like this. Actually, the code in your question looks like it will try to send a hexadecimal string representation of the binary data, which, probably is not what you intended and even if you did intend to do that, (a) you...

UDP recvfrom data not displaying properly

c,sockets,network-programming

printf("%s\n", buffer); That should be printf("%.*s\n", charactersRead, buffer); You're ignoring the count. And if buffer is a pointer, sizeof buffer is only going to give you the size of the pointer, not the size of what it points to....

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

networking,network-programming

There are lots of tools you can use, to a certain degree depending on which amount of data you expect: Wireshark, SoapUI or any similar "proxy", your favorite browsers F12 tool, ... Wireshark is rather complex but it has nice statistics functions or plugins....

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

c#,wcf,network-programming,impersonation,credentials

Your expectation that credentials should be passed over second "hop" is wrong - server can't pass impersonation to yet another server using regular Windows authentication. Why you see A->A->C working - your credentials are not leaving box where you originally signed in (A) and still have one "hop" to C...

multiple clients cannot listen and write at the same time

python,network-programming,client-server,client

Create two threads, one for receiving the other for sending. This is the simplest way to do. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect("address") def send_msg(sock): while True: data = sys.stdin.readline() sock.send(data) def recv_msg(sock): while True: data, addr = sock.recv(1024) sys.stdout.write(data) Thread(target=send_msg, args=(sock,)).start() Thread(target=recv_msg, args=(sock,)).start() ...

SNMP :snmpwalk response from NAS timeout issue

linux,network-programming,snmp,nas

I suggest install protocol analyzer e.g. wireshark to see what is really going on at the SNMP protocol level

Does listen() backlog affect established TCP connections?

sockets,tcp,network-programming

Does listen() backlog affect established TCP connections? It affects established connections that the server hasn't accepted yet via accept(), only in the sense that it limits the number of such connections that can exist. Would it be naive to create a TCP socket with a listen backlog set to...

EC2 Multiple Simultaneous Network Requests With Python

python,amazon-web-services,network-programming

As long as your application creates it's own socket you should be splitting bandwidth. You can check if it's true with sudo netstat -apeen command....

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

linux,shell,ssh,network-programming,aix

For Linux, I might do this something like so (using bash extensions, so invoked using a #!/bin/bash shebang, or piping the script over stdin to an interpreter invoked as ssh "$hostname" bash <<'EOF'): internet_address=8.8.8.8 # read data for the NIC used to route here dev_re='dev ([^[:space:]]+)($|[[:space:]])' read default_route < <(ip...

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

java,string,sockets,network-programming

As it turns out, the ready() method guaruntees only that the next read WON'T block. Consequently, !ready() does not guaruntee that the next read WILL block. Just that it could. I believe that the problem here had to do with the TCP stack itself. Being stream-oriented, when bytes were written...

Get network interfaces on remote machine

java,network-programming

No, we cannot by definition. The IP address is needed to hide the mac address from external world. To retrieve it you definitely need some code running on that machine. It means that you need some kind of agent. You can either implement it in Java or use platform specific...

Creating key:attribute pairs in networkx for Python

python,network-programming

You need to pass in a dictionary as the third parameter for set_node_attribute, one that's aligned with the graph. See if this code does what you need: import numpy as np import networkx as nx array1 = np.arange(256) array2 = np.arange(256) * 10 g = nx.Graph() valdict = {} for...

Assign network response sooner

ios,network-programming

While its probably not the most ideal solution, I've managed to fix the problem by setting a delay, using dispatch_after in the shouldPerformSegueWithIdentifier to delay the alert by about 5 seconds. The message appears first time now which is what I'm looking for.

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

sockets,network-programming,multicast

Problem solved. I need to specify the multicast group to bind to in the receiver, not just the port. This SO question clued me in. By leaving the address as '' in the Python code, or INADDR_ANY in my C++, I am basically telling the OS that I want all...

How to read/send packets correctly?

c++,network-programming,packet

You are sending sizeof(packet) bytes. But sizeof(packet) is 4, because packet is a pointer. You need a better way to keep track of the actual size you want to send.

The meaning of Java's DatagramChannel.write()

java,sockets,network-programming,udp

DatagramChannel is part of java.nio package. It will take a parameter as ByteBuffer to send to the connected channel. Before trying to send you should connect using InetSocketAddress, which takes the host ip and port as parameter. connect(SocketAddress remote) --> connects the channel to the underlying socket. you can get...

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

java,networking,network-programming

Your server is barfing at the signature-verifying stage here: if (!result) { System.out.println("[SERVER]: SSL-connection could not be established..."); CloseConnection(-1); } and closing the socket without sending the FINISHED message. Check its output log. In such a case maybe you should send an error object first. Or else treat EOFException as...