network-programming

several UDP sockets, bound to same port?

假如想象 提交于 2019-12-25 04:37:05
问题 first - it's not a question of "how to bind to port of another software". now, i have a client-server app, based on TCP and i'd like to make it UDP, but i'm missing something.. i have 2 rules (which i put) to this app: 1) the "server" can stay behind router without any port forwarding configuration. 2) the "client" can listen to only one port. in TCP i do it like this: 1) the server opens initial connection to the client on port X. 2) when the client wants to open communication channel to the

update a variable in GNU Radio over the network

一世执手 提交于 2019-12-25 04:10:14
问题 I am using GNU Radio to stream RF data out using a UDP sink. The data is streamed to a controlling program. As part of this process I am frequency shifting (with a multiply block), filtering and down sampling. I would like to change the values of frequency shift at run time. Is there a way for me to have values from a UDP source saved directly to a variable? The only solution I can think of now is to forever generate a sine wave and then pipe that into GNU Radio, and then multiply my signal

How to simulate a blocking send() using WSASend() and IOCP?

浪子不回头ぞ 提交于 2019-12-25 04:05:03
问题 Edit: This question is not necessary, as the WSASend() function can inherently be used in a blocking mode, even if the socket has the overlapped attribute and is associated with a completion port. To use it in a blocking mode: just don't supply an overlapped structure or a completion routine when calling WSASend() . I want to make sure that when I send data, the function will only return when this data has been placed in the send buffer. So this is what I come up with (pseudo code): void

UDP Client receives only 1 message

情到浓时终转凉″ 提交于 2019-12-25 03:52:34
问题 I have a server client application that I am currently working on. The server is receiving data fine over a WAN and the client seems to receive the data, but the client is only receiving one communication. Is there anything over a WAN that would make a client always only receive the first return UDP communication and none of the subsequent. Thanks for the help. Client UDP Listening code private void receiveUDP() { System.Net.IPEndPoint test = new System.Net.IPEndPoint(System.Net.IPAddress.Any

How to read text from internet with C++

爱⌒轻易说出口 提交于 2019-12-25 03:26:43
问题 I trying get text data from internet with C++ but I couldn't find anything useful. like python; import urllib data = urllib.urlopen("examplesite.com/data.txt").read() 回答1: Take a look at libcurl. It is a C library, with C++ bindings. The libcurl website includes a collection of examples in C, including one that copies a URL to a block of memory, getinmemory.c For C++, the main page of the curlcpp binding at https://github.com/JosephP91/curlcpp shows an example of downloading a URL to a file.

TCP Connections in Go

醉酒当歌 提交于 2019-12-25 03:17:36
问题 Here is my code: package main import ( "fmt" "net" ) func main() { addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:8081") listener, _ := net.ListenTCP("tcp", addr) fmt.Printf("listener addr: %s\n", listener.Addr().String()) for { conn, err := listener.AcceptTCP() if err != nil { // handle error fmt.Println("err") return } go handleConnection(conn) } } func handleConnection(conn *net.TCPConn) { fmt.Printf("conn addr: %s\n", conn.LocalAddr().String()) fmt.Printf("conn remote addr: %s\n", conn

Objective C reachability of LAN devices

主宰稳场 提交于 2019-12-25 03:15:16
问题 I need write a program on Mac OS X to manage some number of projectors on the LAN (using IP address), and I'm trying to figure out how to monitor their connection status. Something like a simple ping just to make sure I can reach them. I've tried using the NSURLRequest requestWithURL call. It worked, but the program stops responding for quite a while if any of the projectors are offline. I'm just looking to get the status and change the UI indication. Are there better ways to do this? Any

Objective C reachability of LAN devices

拥有回忆 提交于 2019-12-25 03:15:12
问题 I need write a program on Mac OS X to manage some number of projectors on the LAN (using IP address), and I'm trying to figure out how to monitor their connection status. Something like a simple ping just to make sure I can reach them. I've tried using the NSURLRequest requestWithURL call. It worked, but the program stops responding for quite a while if any of the projectors are offline. I'm just looking to get the status and change the UI indication. Are there better ways to do this? Any

Create batch script to edit host file by network connection

限于喜欢 提交于 2019-12-25 03:12:27
问题 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 81.155.145.48 ns1.intranet.de >> %hostspath% exit thx for your help 回答1: You can get the network name (SSID) of the currently connected wireless network using the

determine if the bits are encrypted?

假如想象 提交于 2019-12-25 03:06:21
问题 let's assume that I am listening a network , and I acquired some bits, but I want to know if there is a way to determine bits are encrypted ? what method or algorithm exists ? I mean if the bits are meaningless, it means encrypted but is there are more technical approach or algorithm to determine from bits let's say I have 0101010100001011001001100001001, how would you tell that if this is encrypted ? 回答1: Generally speaking, you can't. Encrypted data is, in almost all cases,