This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?i)C:/Users/[^/]+/Music/iTunes/iTunes Media/Mobile Applications/.* | |
(?i)C:/Users/(Default|Public|All Users|Default User)/.* | |
(?i).*/(desktop\.ini|thumbs.db|ntuser\.ini) | |
(?i).*\.(bak|tmp|log[0-9]*|old) | |
(?i)C:/Users/[^/]+/(Application Data|NetHood|Contacts|Cookies|Dropbox|Links|Local Settings|My Documents|PrintHood|Recent|riotsGamesLogs|Saved Games|Searches|SendTo|시작 메뉴)/.* | |
(?i)D:/CrashPlan/.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/hairtunes.c b/hairtunes.c | |
index 6859cff..b5f3e7e 100644 | |
--- a/hairtunes.c | |
+++ b/hairtunes.c | |
@@ -417,17 +417,25 @@ static void *rtp_thread_func(void *arg) { | |
int sock = rtp_sockets[0], csock = rtp_sockets[1]; | |
int readsock; | |
char type; | |
+ struct timeval timeout; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function help() { | |
echo 'Want to embed this Gist?' | |
echo 'Use this: {{gist id="2959515"/}}' | |
} | |
$ help | |
Want to embed this Gist? | |
Use this: {{gist id="2959515"/}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
... | |
<dependency> | |
<groupId>io.netty</groupId> | |
<artifactId>netty</artifactId> | |
<version>X.Y.Z.Q</version> | |
<scope>compile</scope> | |
</dependency> | |
... | |
</dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.Unpooled; | |
import java.nio.ByteOrder; | |
ByteBuf buf = Unpooled.buffer(4); | |
buf.setInt(0, 1); | |
// Prints '00000001' | |
System.out.format("%08x%n", buf.getInt(0)); | |
ByteBuf leBuf = buf.order(ByteOrder.LITTLE_ENDIAN); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before: | |
void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception; | |
void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception; | |
// After: | |
void channelRegistered(ChannelHandlerContext ctx) throws Exception; | |
void channelUnregistered(ChannelHandlerContext ctx) throws Exception; | |
void channelActive(ChannelHandlerContext ctx) throws Exception; | |
void channelInactive(ChannelHandlerContext ctx) throws Exception; | |
void inboundBufferUpdated(ChannelHandlerContext ctx) throws Exception; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before: | |
ctx.sendUpstream(evt); | |
// After: | |
ctx.fireInboundBufferUpdated(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ChannelHandler { | |
void beforeAdd(ChannelHandlerContext ctx) throws Exception; | |
void afterAdd(ChannelHandlerContext ctx) throws Exception; | |
void beforeRemove(ChannelHandlerContext ctx) throws Exception; | |
void afterRemove(ChannelHandlerContext ctx) throws Exception; | |
void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception; | |
void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void inboundBufferUpdated(ChannelHandlerContext ctx) { | |
if (ctx.hasInboundByteBuffer()) { | |
ByteBuf buf = ctx.inboundByteBuffer(); | |
... | |
} else { | |
Queue<MyMessage> buf = ctx.inboundMessageBuffer(); | |
for (;;) { | |
MyMessage msg = buf.poll(); | |
if (buf == null) { | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void messageReceived(ChannelHandlerContext ctx, MessageEvent evt) { | |
Object msg = evt.getMessage(); | |
if (msg instanceof ChannelBuffer) { | |
ChannelBuffer buf = (ChannelBuffer) msg; | |
... | |
} else { | |
MyMessage myMsg = (MyMessage) msg; | |
... | |
} |
OlderNewer