network-programming

How to detect datacard connect and disconnect event on win32?

爷,独闯天下 提交于 2019-12-23 06:07:43
问题 I have a data card, as soon as I insert the data card, I am getting the events by using wm_device_change event. But I also want to get event, when my data connect actually connects to the outside world. I mean to say, as soon as we click on connect/disconnect button of data card, I want to get the event. In other words, I want to know when connection is established and disconnected. The data card is a Vodaphone data card and I am trying to browse using that data card. Whatever is the SDK,

Java Socket Programming with concurrent I/O

99封情书 提交于 2019-12-23 05:32:17
问题 I just got an assignment.It is to design a java socket server which accepts incoming client connections.The server's job is to accept it and keep track of all the connected clients and it has to advertise the connected client list to all the clients that connect.I am a newbie to Java.I just know that this task has to be completed with the help of threads.I have some knowledge in Java I/O,Networking and Threads.But I am unable to collaborate all these concepts in one single application.It

Examples of Java I/O Stream Filters

僤鯓⒐⒋嵵緔 提交于 2019-12-23 05:21:21
问题 I am looking for example code that demonstrates how to create a filter that understands binary data. Links to examples are greatly appreciated. 回答1: If you mean examples of FilterInputStream/FilterOutputStream, then you need look no further than the JDK. I'll talk about the input stream variant for the sake of argument, but the same applies to output streams. Take a look at InflaterInputStream, for example. Look at the arry read() method, and notice how at some point if calls fill(), which in

reliable multicast in C#

霸气de小男生 提交于 2019-12-23 05:15:42
问题 what are my options for reliable multicast in c# /.Net 3.5? I don’t want to use MSMQ. I am open to commercial as well as open source options. Thanks 回答1: Take a look at EmCaster 回答2: http://www.29west.com/ claims to be the lowest latency reliable multicast solution available. I have not verified this claim, but in talking to them, it seems that their biggest competition is not some other vendor, but in house developemnt. Why not just set up your own multicast group, and use it directly?

In Java, how do I deal with UDP messages that are greater than the maximum UDP data payload?

只谈情不闲聊 提交于 2019-12-23 04:11:41
问题 I read this question about the error that I'm getting and I learned that UDP data payloads can't be more than 64k. The suggestions that I've read are to use TCP, but that is not an option in this particular case. I am interfacing with an external system that is transmitting data over UDP, but I don't have access to that external system at this time, so I'm simulating it. I have data messages that are upwards of 1,400,000 bytes in some instances and it's a requirement that the UDP protocol is

In Java, how do I deal with UDP messages that are greater than the maximum UDP data payload?

允我心安 提交于 2019-12-23 04:11:26
问题 I read this question about the error that I'm getting and I learned that UDP data payloads can't be more than 64k. The suggestions that I've read are to use TCP, but that is not an option in this particular case. I am interfacing with an external system that is transmitting data over UDP, but I don't have access to that external system at this time, so I'm simulating it. I have data messages that are upwards of 1,400,000 bytes in some instances and it's a requirement that the UDP protocol is

Time out idle connections in epoll based server

风流意气都作罢 提交于 2019-12-23 03:36:11
问题 I'm writing a tcp server in c that uses epoll() i/o multiplexing to manage concurrent connections. I want to timeout connections that have been idle for more than an allowed time. So far I keep a last_active time_t variable associated with each connection, which I update to the current time in the event handler. Before doing that, I check if more than the allowed time has ellapsed since last event and if so I terminate the connection. So far so good but it's not really what I want because the

Can reply be optional in ZeroMQ?

China☆狼群 提交于 2019-12-23 03:29:06
问题 I'm implementing a Lamport's distributed MUTEX algorithm in ZeroMQ. Algorithm : Requesting process 1 ) Pushing its request in its own queue (ordered by time stamps) 2 ) Sending a request to every node. 3 ) Waiting for replies from all other nodes. 4 ) If own request is at the head of its queue and all replies have been received, enter critical section. 5 ) Upon exiting the critical section, remove its request from the queue and send a release message to every process. Other processes 1 )

Non-blocking TCP socket handling - How to detect blocking state prior to writing on to the socket?

爷,独闯天下 提交于 2019-12-23 03:18:05
问题 I'm currently writing a proxy application that reads from one socket and writes on another. Both are set as non-blocking, allowing multiple sockets pairs to be handle. To control a proper flow between the sockets, the application should NOT read from the source socket if the writing on the target socket may block. The idea is nice, however I found no way to detect a blocking state of the target socket without first writing to it... and that is not what is needed. I know of an option to use

make command not working in NS 2.35

最后都变了- 提交于 2019-12-23 02:32:22
问题 I am trying to modify AODV routing protocol using NS 2.35. I have made some changes to the files aodv.cc and aodv.h. Now, to apply these changes I have run a make command inside ns-allinone-2.35/ns-2.35 folder and getting the following error message: In file included from aodv/aodv_logs.cc:31:0: ./aodv/aodv.h:53:18: fatal error: list.h: No such file or directory #include <list.h> ^ compilation terminated. make: *** [aodv/aodv_logs.o] Error 1 How will I solve this? 回答1: #include <list.h> is