protocols

Objective-C Protocol Madness -- how to return object based on protocol?

@protocol Eating @end @interface Eat : NSObject<Eating> { } - (id<Eating> *)me; @end @implementation Eat - (id<Eating> *)me { return self; } @end In the above piece of Objective-C code, why does "return self" result in a "Return from incompatible pointer type" warning? What's the incompatible pointer type and how to fix it? ...

HTTP: How should I show Content-Type and Content-Disposition when the client requests a byte range?

Yesterday I asked about serving byte ranges from PHP. Today my question is - how should I set Content-Type and Content-Disposition headers when serving several requested byte ranges? Should I repeat them for every byte range or should I just output them once at the beginning? Or maybe I shouldn't output them at all because the client sho...

protocol development to programming image processing algorithms

For a long time (about 10 years now), I have been mostly developing firmware and device drivers for protocols like USB, SCSI, Firewire, etc ... but recently (owing to many inexplainable reasons) had to switch to programming related to Image processing. I think it is fun, but I am feeling like a novice for sometimes now. Now my question...

Accessing a WCF-service using Java

I'm developing a web-service using WCF, which I want to access using a client written in Java. I will encode the messages using Protocol Buffers (with Marc Gravell's protobuf-net to be exact). Is this possible to achive or must the client be written in .NET as well? I know that data serialized with Protocol Buffers is binary interopable...

Objective-C protocols mimicking 'virtual-functions' yield compiler warnings?

In Objective-C, I'd like to force derived classes to implement a given interface without providing a default implementation (an implementation in the parent class). I understand that Protocols can be used for this, and I believe I understand how to use Protocols, but I'm apparently missing something... I have defined class Parent, and ...

Protocol Buffers Java RPC Stack

According to this Wikipedia entry: "Protocol Buffers is very similar to Facebook’s Thrift protocol, except it does not include a concrete RPC stack to use for defined services. Since Protocol Buffers was open sourced, a number of RPC stacks have emerged to fill this gap." However, there are no examples of RPC stacks cited. Can anyone ...

Good tools to understand / reverse engineer a top layer network protocol

Hi Guys, There is an interesting problem at hand. I have a role-playing MMOG running through a client application (not a browser) which sends the actions of my player to a server which keeps all the players in sync by sending packets back. Now, the game uses a top layer protocol over TCP/IP to send the data. However, wireshark does not...

How could we fool the HTTP protocol?

Although HTTP is ubiquitous it comes with its baggage of Headers which in my case is becoming more of a problem. My data to be transferred is an iota of the HTTP header size. Is there another protocol that I can use which is still understood by the browsers and other networks and doesn't come with the baggage of HTTP? Any other way t...

What things should be kept in mind while desigining an HTTP based protocol?

I have heard that http is a nice way to design my own protocol. although i can design a binary protocol, i would prefer to follow the HTTP standard to design my protocol. basically the flow of the application is that with the request the client sends some parameter strings to the server, the server sends the response string to the applic...

Vote for the best protocol for the given scenario

Hello! I have a design decision to make. I need your advice. Requirements: A server and a client. client is typically a mobile phone. Connected through the Internet. Server and client want to talk to each other. Exchange of text, multimedia between the client and the server. Text would be some standard format. that is predecided. Rea...

What problems might occur if a USB device is not USB 2.0 compliant?

I have a Full Speed device that specifies the max packet size as 256 bytes. This is not USB compliant since the maxiumum packet size for a Full Speed Device should be 64 bytes. I can read (ReadFile) and write (WriteFile) to the device just fine, but I'm wondering if there could be issues that could arise that I'm just not seeing other ...

How to handle different protocol versions transparently in c++?

This is a generic C++ design question. I'm writing an application that uses a client/server model. Right now I'm writing the server-side. Many clients already exist (some written by myself, others by third parties). The problem is that these existing clients all use different protocol versions (there have been 2-3 protocol changes over ...

How to create new folder on POP3 protocol

I want to create a folder with the name "Spam" by using Javamail Api, but I'm not allowed to create any folder on POP3 protocol. What should I do? ...

HTTP and HTTPS Protocols

Hi, my question is related to hypertext protocol. what is the requirements from my side to be able to use HTTPS instead of HTTP in the areas where a user will enter confident information or when there is a registration process. Thank you. ...

Defining categories for protocols in Objective-C?

In Objective-C, I can add methods to existing classes with a category, e.g. @interface NSString (MyCategory) - (BOOL) startsWith: (NSString*) prefix; @end Is it also possible to do this with protocols, i.e. if there was a NSString protocol, something like: @interface <NSString> (MyCategory) - (BOOL) startsWith: (NSString*) prefix; @e...

How to insert repeated message in google protocol buffer _pb2.py file

How to insert repeated message in google protocol buffer _pb2.py file ...

What is the easiest way to use the HEAD command of HTTP in PHP?

I would like to send the HEAD command of the Hypertext Transfer Protocol to a server in PHP to retrieve the header, but not the content or a URL. How do I do this in an efficient way? The probably most common use-case is to check for dead web links. For this I only need the reply code of the HTTP request and not the page content. Gettin...

Detect H.323 by simple sniffing?

Is it possible to detect if a H.323 connection (phone call) is up by simple sniffing traffic on an adjacent node? ...

ARP protocol : is ARP source hardware address redundant? (already contained in ethernet header)

Hi, I'm working on a network security project and I noticed something that I can't explain: Why do we need a source hardware address field in arp? Isn't it already contained in the ethernet header? Cheers, Laurent ...

How to detect wether remote computer is running RDP (remote desktop protocol) ?

How do I detect if a remote client is running Remote Desktop Protocol? and it is also accepting remote desktop connections ?? Like Open an port to detect HTTP and send request, receive request headers and see in request headers information about HTTP so I will know the person is running HTTP weather if he changed the port e.g: running H...